mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge remote-tracking branch 'DefinitelyTyped/master'
This commit is contained in:
Vendored
+51
-15
@@ -345,18 +345,47 @@ declare namespace AceAjax {
|
||||
insert(position: Position, text: string): any;
|
||||
|
||||
/**
|
||||
* Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event.
|
||||
* @param row The index of the row to insert at
|
||||
* @param lines An array of strings
|
||||
**/
|
||||
* @deprecated Use the insertFullLines method instead.
|
||||
*/
|
||||
insertLines(row: number, lines: string[]): any;
|
||||
|
||||
/**
|
||||
* Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event.
|
||||
* @param position The position to insert at
|
||||
**/
|
||||
* Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event.
|
||||
* @param {Number} row The index of the row to insert at
|
||||
* @param {Array} lines An array of strings
|
||||
* @returns {Object} Contains the final row and column, like this:
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
|
||||
* ```
|
||||
* {row: row, column: 0}
|
||||
* ```
|
||||
*
|
||||
**/
|
||||
insertFullLines(row: number, lines: string[]): any;
|
||||
|
||||
/**
|
||||
* @deprecated Use insertMergedLines(position, ['', '']) instead.
|
||||
*/
|
||||
insertNewLine(position: Position): any;
|
||||
|
||||
/**
|
||||
* Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event.
|
||||
* @param {Number} row The index of the row to insert at
|
||||
* @param {Array} lines An array of strings
|
||||
* @returns {Object} Contains the final row and column, like this:
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
|
||||
* ```
|
||||
* {row: row, column: 0}
|
||||
* ```
|
||||
*
|
||||
**/
|
||||
insertMergedLines(row: number, lines: string[]): any;
|
||||
|
||||
/**
|
||||
* Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event.
|
||||
* @param position The position to insert at
|
||||
@@ -379,12 +408,19 @@ declare namespace AceAjax {
|
||||
removeInLine(row: number, startColumn: number, endColumn: number): any;
|
||||
|
||||
/**
|
||||
* Removes a range of full lines. This method also triggers the `'change'` event.
|
||||
* @param firstRow The first row to be removed
|
||||
* @param lastRow The last row to be removed
|
||||
**/
|
||||
* @deprecated Use the removeFullLines method instead.
|
||||
*/
|
||||
removeLines(firstRow: number, lastRow: number): string[];
|
||||
|
||||
/**
|
||||
* Removes a range of full lines. This method also triggers the `"change"` event.
|
||||
* @param {Number} firstRow The first row to be removed
|
||||
* @param {Number} lastRow The last row to be removed
|
||||
* @returns {[String]} Returns all the removed lines.
|
||||
*
|
||||
**/
|
||||
removeFullLines(firstRow: number, lastRow: number): string[];
|
||||
|
||||
/**
|
||||
* Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event.
|
||||
* @param row The row to check
|
||||
@@ -474,9 +510,9 @@ declare namespace AceAjax {
|
||||
removeFold(arg: any): void;
|
||||
|
||||
expandFold(arg: any): void;
|
||||
|
||||
|
||||
foldAll(startRow?: number, endRow?: number, depth?: number): void
|
||||
|
||||
|
||||
unfold(arg1: any, arg2: boolean): void;
|
||||
|
||||
screenToDocumentColumn(row: number, column: number): void;
|
||||
@@ -2659,9 +2695,9 @@ declare namespace AceAjax {
|
||||
characterWidth: number;
|
||||
|
||||
lineHeight: number;
|
||||
|
||||
|
||||
setScrollMargin(top:number, bottom:number, left: number, right: number): void;
|
||||
|
||||
|
||||
screenToTextCoordinates(left: number, top: number): void;
|
||||
|
||||
/**
|
||||
|
||||
+25
@@ -35,6 +35,7 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
constructor(options: ActionsSdkAppOptions);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Validates whether request is from Assistant through signature verification.
|
||||
* Uses Google-Auth-Library to verify authorization token against given
|
||||
* Google Cloud Project ID. Auth token is given in request header with key,
|
||||
@@ -58,6 +59,30 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
*/
|
||||
isRequestFromAssistant(projectId: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Validates whether request is from Google through signature verification.
|
||||
* Uses Google-Auth-Library to verify authorization token against given
|
||||
* Google Cloud Project ID. Auth token is given in request header with key,
|
||||
* "Authorization".
|
||||
*
|
||||
* @example
|
||||
* const app = new ActionsSdkApp({request, response});
|
||||
* app.isRequestFromGoogle('nodejs-cloud-test-project-1234')
|
||||
* .then(() => {
|
||||
* app.ask('Hey there, thanks for stopping by!');
|
||||
* })
|
||||
* .catch(err => {
|
||||
* response.status(400).send();
|
||||
* });
|
||||
*
|
||||
* @param projectId Google Cloud Project ID for the Assistant app.
|
||||
* @return Promise resolving with google-auth-library LoginTicket
|
||||
* if request is from a valid source, otherwise rejects with the error reason
|
||||
* for an invalid token.
|
||||
* @actionssdk
|
||||
*/
|
||||
isRequestFromGoogle(projectId: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Gets the request Conversation API version.
|
||||
*
|
||||
|
||||
+212
-53
@@ -10,58 +10,36 @@ import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, L
|
||||
* @dialogflow
|
||||
*/
|
||||
export enum StandardIntents {
|
||||
/**
|
||||
* App fires MAIN intent for queries like [talk to $app].
|
||||
*/
|
||||
/** App fires MAIN intent for queries like [talk to $app]. */
|
||||
MAIN,
|
||||
/**
|
||||
* App fires TEXT intent when action issues ask intent.
|
||||
*/
|
||||
/** App fires TEXT intent when action issues ask intent. */
|
||||
TEXT,
|
||||
/**
|
||||
* App fires PERMISSION intent when action invokes askForPermission.
|
||||
*/
|
||||
/** App fires PERMISSION intent when action invokes askForPermission. */
|
||||
PERMISSION,
|
||||
/**
|
||||
* App fires OPTION intent when user chooses from options provided.
|
||||
*/
|
||||
/** App fires OPTION intent when user chooses from options provided. */
|
||||
OPTION,
|
||||
/**
|
||||
* App fires TRANSACTION_REQUIREMENTS_CHECK intent when action sets up transaction.
|
||||
*/
|
||||
/** App fires TRANSACTION_REQUIREMENTS_CHECK intent when action sets up transaction. */
|
||||
TRANSACTION_REQUIREMENTS_CHECK,
|
||||
/**
|
||||
* App fires DELIVERY_ADDRESS intent when action asks for delivery address.
|
||||
*/
|
||||
/** App fires DELIVERY_ADDRESS intent when action asks for delivery address. */
|
||||
DELIVERY_ADDRESS,
|
||||
/**
|
||||
* App fires TRANSACTION_DECISION intent when action asks for transaction decision.
|
||||
*/
|
||||
/** App fires TRANSACTION_DECISION intent when action asks for transaction decision. */
|
||||
TRANSACTION_DECISION,
|
||||
/**
|
||||
* App fires CONFIRMATION intent when requesting affirmation from user.
|
||||
*/
|
||||
/** App fires CONFIRMATION intent when requesting affirmation from user. */
|
||||
CONFIRMATION,
|
||||
/**
|
||||
* App fires DATETIME intent when requesting date/time from user.
|
||||
*/
|
||||
/** App fires DATETIME intent when requesting date/time from user. */
|
||||
DATETIME,
|
||||
/**
|
||||
* App fires SIGN_IN intent when requesting sign-in from user.
|
||||
*/
|
||||
/** App fires SIGN_IN intent when requesting sign-in from user. */
|
||||
SIGN_IN,
|
||||
/**
|
||||
* App fires NO_INPUT intent when user doesn't provide input.
|
||||
*/
|
||||
/** App fires NO_INPUT intent when user doesn't provide input. */
|
||||
NO_INPUT,
|
||||
/**
|
||||
* App fires CANCEL intent when user exits app mid-dialog.
|
||||
*/
|
||||
/** App fires CANCEL intent when user exits app mid-dialog. */
|
||||
CANCEL,
|
||||
/**
|
||||
* App fires NEW_SURFACE intent when requesting handoff to a new surface from user.
|
||||
*/
|
||||
/** App fires NEW_SURFACE intent when requesting handoff to a new surface from user. */
|
||||
NEW_SURFACE,
|
||||
/** App fires REGISTER_UPDATE intent when requesting the user to register for proactive updates. */
|
||||
REGISTER_UPDATE,
|
||||
/** App receives CONFIGURE_UPDATES intent to indicate a custom REGISTER_UPDATE intent should be sent. */
|
||||
CONFIGURE_UPDATES
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,6 +63,10 @@ export enum SupportedPermissions {
|
||||
* {@link https://developers.google.com/actions/reference/conversation#Location|Location object}.
|
||||
*/
|
||||
DEVICE_COARSE_LOCATION,
|
||||
/**
|
||||
* Confirmation to receive proactive content at any time from the app.
|
||||
*/
|
||||
UPDATE
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,6 +119,8 @@ export enum BuiltInArgNames {
|
||||
* New surface value argument.
|
||||
*/
|
||||
NEW_SURFACE,
|
||||
/** Update registration value argument. */
|
||||
REGISTER_UPDATE
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,8 +128,17 @@ export enum BuiltInArgNames {
|
||||
* {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
* @deprecated Use {@link ConversationTypes} instead.
|
||||
*/
|
||||
export enum ConversationStages {
|
||||
export type ConversationStages = ConversationTypes;
|
||||
|
||||
/**
|
||||
* List of possible conversation types, as defined in the
|
||||
* {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
export enum ConversationTypes {
|
||||
/**
|
||||
* Unspecified conversation state.
|
||||
*/
|
||||
@@ -224,6 +217,13 @@ export enum SignInStatus {
|
||||
ERROR
|
||||
}
|
||||
|
||||
/**
|
||||
* Possible update trigger time context frequencies.
|
||||
*/
|
||||
export enum TimeContextFrequency {
|
||||
DAILY
|
||||
}
|
||||
|
||||
/**
|
||||
* User provided date/time info.
|
||||
*/
|
||||
@@ -277,6 +277,17 @@ export interface User {
|
||||
userName: UserName;
|
||||
/** Unique Oauth2 token. Only available with account linking. */
|
||||
accessToken: string;
|
||||
/**
|
||||
* Timestamp for the last access from the user.
|
||||
* Retrieve using app.getLastSeen() to get a Date object or null if never seen.
|
||||
*/
|
||||
lastSeen: string;
|
||||
/**
|
||||
* A string persistent across sessions.
|
||||
* Retrieved and set using app.userStorage which allows you to store it like an JSON object
|
||||
* which is abstracted for convenience by the client library.
|
||||
*/
|
||||
userStorage: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,6 +306,17 @@ export interface Capability {
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intent Argument. For incoming intents, the argument value can be retrieved
|
||||
* using {@link AssistantApp#getArgument}.
|
||||
*/
|
||||
export interface IntentArgument {
|
||||
/** Name of the argument. */
|
||||
name: string;
|
||||
/** Text value of the argument. */
|
||||
textValue: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Actions on Google client library AssistantApp base class.
|
||||
*
|
||||
@@ -313,6 +335,20 @@ export class AssistantApp {
|
||||
*/
|
||||
data: object;
|
||||
|
||||
/**
|
||||
* The data persistent across sessions in JSON format.
|
||||
* It exists in the same context as getUser().userId
|
||||
*
|
||||
* @example
|
||||
* // Actions SDK
|
||||
* const app = new ActionsSdkApp({request: request, response: response});
|
||||
* app.userStorage.someProperty = 'someValue';
|
||||
* // Dialogflow
|
||||
* const app = new DialogflowApp({request: request, response: response});
|
||||
* app.userStorage.someProperty = 'someValue';
|
||||
*/
|
||||
userStorage: object;
|
||||
|
||||
/**
|
||||
* List of standard intents that the app provides.
|
||||
* @actionssdk
|
||||
@@ -339,8 +375,17 @@ export class AssistantApp {
|
||||
* {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
* @deprecated Use {@link ConversationTypes} instead.
|
||||
*/
|
||||
readonly ConversationStages: typeof ConversationStages;
|
||||
readonly ConversationStages: typeof ConversationTypes;
|
||||
|
||||
/**
|
||||
* List of possible conversation types, as defined in the
|
||||
* {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
readonly ConversationTypes: typeof ConversationTypes;
|
||||
|
||||
/**
|
||||
* List of surface capabilities supported by the app.
|
||||
@@ -368,6 +413,11 @@ export class AssistantApp {
|
||||
*/
|
||||
readonly Transactions: typeof TransactionValues;
|
||||
|
||||
/**
|
||||
* Possible update trigger time context frequencies.
|
||||
*/
|
||||
readonly TimeContextFrequency: typeof TimeContextFrequency;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public APIs
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -477,7 +527,7 @@ export class AssistantApp {
|
||||
* @param permissions Array of permissions App supports, each of
|
||||
* which comes from AssistantApp.SupportedPermissions.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return A response is sent to Assistant to ask for the user's permission; for any
|
||||
* invalid input, we return null.
|
||||
* @actionssdk
|
||||
@@ -485,6 +535,58 @@ export class AssistantApp {
|
||||
*/
|
||||
askForPermissions(context: string, permissions: string[], dialogState?: object): express.Response | null;
|
||||
|
||||
/**
|
||||
* Prompts the user for permission to send proactive updates at any time.
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({request, response});
|
||||
* const REQUEST_PERMISSION_ACTION = 'request.permission';
|
||||
* const PERMISSION_REQUESTED = 'permission.requested';
|
||||
* const SHOW_IMAGE = 'show.image';
|
||||
*
|
||||
* function requestPermission (app) {
|
||||
* app.askForUpdatePermission('show.image', [
|
||||
* {
|
||||
* name: 'image_to_show',
|
||||
* textValue: 'image_type_1'
|
||||
* }
|
||||
* ]);
|
||||
* }
|
||||
*
|
||||
* function checkPermission (app) {
|
||||
* if (app.isPermissionGranted()) {
|
||||
* app.tell(`Great, I'll send an update whenever I notice a change`);
|
||||
* } else {
|
||||
* // Response shows that user did not grant permission
|
||||
* app.tell('Alright, just let me know whenever you need the weather!');
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* function showImage (app) {
|
||||
* showPicture(app.getArgument('image_to_show'));
|
||||
* }
|
||||
*
|
||||
* const actionMap = new Map();
|
||||
* actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission);
|
||||
* actionMap.set(PERMISSION_REQUESTED, checkPermission);
|
||||
* actionMap.set(SHOW_IMAGE, showImage);
|
||||
* app.handleRequest(actionMap);
|
||||
*
|
||||
* @param intent If using Dialogflow, the action name of the intent
|
||||
* to be triggered when the update is received. If using Actions SDK, the
|
||||
* intent name to be triggered when the update is received.
|
||||
* @param intentArguments The necessary arguments
|
||||
* to fulfill the intent triggered on update. These can be retrieved using
|
||||
* {@link AssistantApp#getArgument}.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return A response is sent to Assistant to ask for the user's permission; for any
|
||||
* invalid input, we return null.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
askForUpdatePermission(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null;
|
||||
|
||||
/**
|
||||
* Checks whether user is in transactable state.
|
||||
*
|
||||
@@ -520,7 +622,7 @@ export class AssistantApp {
|
||||
* options and order options. Optional if order has no payment or
|
||||
* delivery.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
@@ -562,7 +664,7 @@ export class AssistantApp {
|
||||
* transactionConfig Configuration for the transaction. Includes payment
|
||||
* options and order options.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response
|
||||
* @dialogflow
|
||||
*/
|
||||
@@ -737,7 +839,7 @@ export class AssistantApp {
|
||||
* query for an affirmative or negative response. If undefined or null,
|
||||
* Google will use a generic yes/no prompt.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
@@ -782,7 +884,7 @@ export class AssistantApp {
|
||||
* time if not provided by user. If undefined or null, Google will use a
|
||||
* generic prompt.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
@@ -795,11 +897,6 @@ export class AssistantApp {
|
||||
* Retrieve the access token in subsequent intents using
|
||||
* app.getUser().accessToken.
|
||||
*
|
||||
* Note: Currently this API requires enabling the app for Transactions APIs.
|
||||
* To do this, fill out the App Info section of the Actions Console project
|
||||
* and check the box indicating the use of Transactions under "Privacy and
|
||||
* consent".
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({ request, response });
|
||||
* const WELCOME_INTENT = 'input.welcome';
|
||||
@@ -824,7 +921,7 @@ export class AssistantApp {
|
||||
* app.handleRequest(actionMap);
|
||||
*
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
@@ -872,13 +969,53 @@ export class AssistantApp {
|
||||
* @param capabilities The list of capabilities required in
|
||||
* the surface.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}.
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @dialogflow
|
||||
* @actionssdk
|
||||
*/
|
||||
askForNewSurface(context: string, notificationTitle: string, capabilities: SurfaceCapabilities[], dialogState?: object): express.Response | null;
|
||||
|
||||
/**
|
||||
* Requests the user to register for daily updates.
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({ request, response });
|
||||
* const WELCOME_INTENT = 'input.welcome';
|
||||
* const SHOW_IMAGE = 'show.image';
|
||||
*
|
||||
* function welcomeIntent (app) {
|
||||
* app.askToRegisterDailyUpdate('show.image', [
|
||||
* {
|
||||
* name: 'image_to_show',
|
||||
* textValue: 'image_type_1'
|
||||
* }
|
||||
* ]);
|
||||
* }
|
||||
*
|
||||
* function showImage (app) {
|
||||
* showPicture(app.getArgument('image_to_show'));
|
||||
* }
|
||||
*
|
||||
* const actionMap = new Map();
|
||||
* actionMap.set(WELCOME_INTENT, welcomeIntent);
|
||||
* actionMap.set(SHOW_IMAGE, showImage);
|
||||
* app.handleRequest(actionMap);
|
||||
*
|
||||
* @param intent If using Dialogflow, the action name of the intent
|
||||
* to be triggered when the update is received. If using Actions SDK, the
|
||||
* intent name to be triggered when the update is received.
|
||||
* @param intentArguments The necessary arguments
|
||||
* to fulfill the intent triggered on update. These can be retrieved using
|
||||
* {@link AssistantApp#getArgument}.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return HTTP response.
|
||||
* @dialogflow
|
||||
* @actionssdk
|
||||
*/
|
||||
askToRegisterDailyUpdate(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null;
|
||||
|
||||
/**
|
||||
* Gets the {@link User} object.
|
||||
* The user object contains information about the user, including
|
||||
@@ -945,6 +1082,18 @@ export class AssistantApp {
|
||||
*/
|
||||
getUserLocale(): string;
|
||||
|
||||
/**
|
||||
* Get the user's last seen time as a Date object.
|
||||
* Not supported in V1.
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({request, response});
|
||||
* const lastSeen = app.getLastSeen();
|
||||
*
|
||||
* @return User's last seen date or null if never seen
|
||||
*/
|
||||
getLastSeen(): Date | null;
|
||||
|
||||
/**
|
||||
* If granted permission to device's location in previous intent, returns device's
|
||||
* location (see {@link AssistantApp#askForPermissions|askForPermissions}).
|
||||
@@ -1225,6 +1374,16 @@ export class AssistantApp {
|
||||
*/
|
||||
isFinalReprompt(): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if user accepted update registration request. Used with
|
||||
* {@link AssistantApp#askToRegisterDailyUpdate}
|
||||
*
|
||||
* @return True if user accepted update registration request.
|
||||
* @dialogflow
|
||||
* @actionssdk
|
||||
*/
|
||||
isUpdateRegistered(): boolean;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Response Builders
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for actions-on-google 1.5
|
||||
// Type definitions for actions-on-google 1.6
|
||||
// Project: https://github.com/actions-on-google/actions-on-google-nodejs
|
||||
// Definitions by: Joel Hegg <https://github.com/joelhegg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+19
-1
@@ -70,6 +70,24 @@ export interface OptionInfo {
|
||||
synonyms: string[];
|
||||
}
|
||||
|
||||
export interface StructuredResponse {
|
||||
orderUpdate: OrderUpdate;
|
||||
}
|
||||
|
||||
export interface RichResponseItemBasicCard {
|
||||
basicCard: BasicCard;
|
||||
}
|
||||
|
||||
export interface RichResponseItemSimpleResponse {
|
||||
simpleResponse: SimpleResponse;
|
||||
}
|
||||
|
||||
export interface RichResponseItemStructuredResponse {
|
||||
structuredResponse: StructuredResponse;
|
||||
}
|
||||
|
||||
export type RichResponseItem = RichResponseItemBasicCard | RichResponseItemSimpleResponse | RichResponseItemStructuredResponse;
|
||||
|
||||
/**
|
||||
* Class for initializing and constructing Rich Responses with chainable interface.
|
||||
*/
|
||||
@@ -85,7 +103,7 @@ export class RichResponse {
|
||||
* Ordered list of either SimpleResponse objects or BasicCard objects.
|
||||
* First item must be SimpleResponse. There can be at most one card.
|
||||
*/
|
||||
items: Array<SimpleResponse | BasicCard>;
|
||||
items: RichResponseItem[];
|
||||
|
||||
/**
|
||||
* Ordered list of text suggestions to display. Optional.
|
||||
|
||||
+132
-42
@@ -25,8 +25,8 @@ export interface Price {
|
||||
* Order rejection info.
|
||||
*/
|
||||
export interface RejectionInfo {
|
||||
/** One of Transaction.RejectionType. */
|
||||
type: RejectionType;
|
||||
/** One of Transaction.ReasonType. */
|
||||
type: ReasonType;
|
||||
/** Reason for the order rejection. */
|
||||
reason: string;
|
||||
}
|
||||
@@ -51,26 +51,16 @@ export interface CancellationInfo {
|
||||
* Order transit info.
|
||||
*/
|
||||
export interface TransitInfo {
|
||||
/** UTC timestamp of the transit update. */
|
||||
updatedTime: {
|
||||
/** Seconds since Unix epoch. */
|
||||
seconds: number;
|
||||
/** Partial seconds since Unix epoch. */
|
||||
nanos?: number;
|
||||
};
|
||||
/** UTC timestamp of the transit update as an RFC 3339 string. */
|
||||
updatedTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order fulfillment info.
|
||||
*/
|
||||
export interface FulfillmentInfo {
|
||||
/** UTC timestamp of the fulfillment update. */
|
||||
deliveryTime: {
|
||||
/** Seconds since Unix epoch. */
|
||||
seconds: number;
|
||||
/** Partial seconds since Unix epoch. */
|
||||
nanos?: number;
|
||||
};
|
||||
/** UTC timestamp of the fulfillment update as an RFC 3339 string. */
|
||||
deliveryTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +130,7 @@ export interface Location {
|
||||
*/
|
||||
export interface TransactionDecision {
|
||||
/** One of Transactions.ConfirmationDecision. */
|
||||
userDecision: ConfirmationDecision;
|
||||
userDecision: TransactionUserDecision;
|
||||
checkResult: {
|
||||
/** One of Transactions.ResultType. */
|
||||
resultType: ResultType;
|
||||
@@ -175,32 +165,61 @@ export interface TransactionDecision {
|
||||
export const TransactionValues: {
|
||||
/** List of transaction card networks available when paying with Google. */
|
||||
readonly CardNetwork: typeof CardNetwork;
|
||||
/**
|
||||
* List of possible item types.
|
||||
* @deprecated Use {@link TransactionValues.LineItemType} instead.
|
||||
*/
|
||||
readonly ItemType: typeof LineItemType;
|
||||
/** List of possible item types. */
|
||||
readonly ItemType: typeof ItemType;
|
||||
readonly LineItemType: typeof LineItemType;
|
||||
/** List of price types. */
|
||||
readonly PriceType: typeof PriceType;
|
||||
/** List of possible item types. */
|
||||
readonly PaymentType: typeof PaymentType;
|
||||
/** List of customer information properties that can be requested. */
|
||||
readonly CustomerInfoProperties: typeof CustomerInfoProperties;
|
||||
/**
|
||||
* List of possible order confirmation user decisions
|
||||
* @deprecated Use {@link TransactionValues.TransactionUserDecision} instead.
|
||||
*/
|
||||
readonly ConfirmationDecision: typeof TransactionUserDecision;
|
||||
/** List of possible order confirmation user decisions */
|
||||
readonly ConfirmationDecision: typeof ConfirmationDecision;
|
||||
readonly TransactionUserDecision: typeof TransactionUserDecision;
|
||||
/** List of possible order states. */
|
||||
readonly OrderState: typeof OrderState;
|
||||
/**
|
||||
* List of possible actions to take on the order.
|
||||
* @deprecated Use {@link TransactionValues.ActionType} instead.
|
||||
*/
|
||||
readonly OrderAction: typeof ActionType;
|
||||
/** List of possible actions to take on the order. */
|
||||
readonly OrderAction: typeof OrderAction;
|
||||
readonly ActionType: typeof ActionType;
|
||||
/**
|
||||
* List of possible types of order rejection.
|
||||
* @deprecated Use {@link TransactionValues.ReasonType} instead.
|
||||
*/
|
||||
readonly RejectionType: typeof ReasonType;
|
||||
/** List of possible types of order rejection. */
|
||||
readonly RejectionType: typeof RejectionType;
|
||||
readonly ReasonType: typeof ReasonType;
|
||||
/** List of possible order state objects. */
|
||||
readonly OrderStateInfo: typeof OrderStateInfo;
|
||||
/** List of possible order transaction requirements check result types. */
|
||||
readonly ResultType: typeof ResultType;
|
||||
/** List of possible user decisions to give delivery address. */
|
||||
readonly DeliveryAddressDecision: typeof DeliveryAddressDecision;
|
||||
readonly DeliveryAddressDecision: typeof DeliveryAddressUserDecision;
|
||||
/** List of possible user decisions to give delivery address. */
|
||||
readonly DeliveryAddressUserDecision: typeof DeliveryAddressUserDecision;
|
||||
/**
|
||||
* List of possible order location types.
|
||||
* @deprecated Use {@link TransactionValues.OrderLocationType} instead.
|
||||
*/
|
||||
readonly LocationType: typeof OrderLocationType;
|
||||
/** List of possible order location types. */
|
||||
readonly LocationType: typeof LocationType;
|
||||
readonly OrderLocationType: typeof OrderLocationType;
|
||||
/** List of possible order time types. */
|
||||
readonly TimeType: typeof TimeType;
|
||||
/** List of possible tokenization types for the payment method */
|
||||
readonly PaymentMethodTokenizationType: typeof PaymentMethodTokenizationType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -235,8 +254,14 @@ export enum CardNetwork {
|
||||
|
||||
/**
|
||||
* List of possible item types.
|
||||
* @deprecated Use {@link TransactionValues.LineItemType} instead.
|
||||
*/
|
||||
export enum ItemType {
|
||||
export type ItemType = LineItemType;
|
||||
|
||||
/**
|
||||
* List of possible item types.
|
||||
*/
|
||||
export enum LineItemType {
|
||||
/**
|
||||
* Unspecified.
|
||||
*/
|
||||
@@ -323,13 +348,24 @@ export enum PaymentType {
|
||||
* List of customer information properties that can be requested.
|
||||
*/
|
||||
export enum CustomerInfoProperties {
|
||||
CUSTOMER_INFO_PROPERTY_UNSPECIFIED,
|
||||
EMAIL
|
||||
}
|
||||
|
||||
/**
|
||||
* List of possible order confirmation user decisions
|
||||
* @deprecated Use {@link TransactionValues.TransactionUserDecision} instead.
|
||||
*/
|
||||
export enum ConfirmationDecision {
|
||||
export type ConfirmationDecision = TransactionUserDecision;
|
||||
|
||||
/**
|
||||
* List of possible order confirmation user decisions
|
||||
*/
|
||||
export enum TransactionUserDecision {
|
||||
/**
|
||||
* Unspecified user decision.
|
||||
*/
|
||||
UNKNOWN_USER_DECISION,
|
||||
/**
|
||||
* Order was approved by user.
|
||||
*/
|
||||
@@ -353,6 +389,10 @@ export enum ConfirmationDecision {
|
||||
* List of possible order states.
|
||||
*/
|
||||
export enum OrderState {
|
||||
/**
|
||||
* Order was created at the integrator's system.
|
||||
*/
|
||||
CREATED,
|
||||
/**
|
||||
* Order was rejected.
|
||||
*/
|
||||
@@ -381,8 +421,18 @@ export enum OrderState {
|
||||
|
||||
/**
|
||||
* List of possible actions to take on the order.
|
||||
* @deprecated Use {@link TransactionValues.ActionType} instead.
|
||||
*/
|
||||
export enum OrderAction {
|
||||
export type OrderAction = ActionType;
|
||||
|
||||
/**
|
||||
* List of possible actions to take on the order.
|
||||
*/
|
||||
export enum ActionType {
|
||||
/**
|
||||
* Unknown action.
|
||||
*/
|
||||
UNKNOWN,
|
||||
/**
|
||||
* View details.
|
||||
*/
|
||||
@@ -418,13 +468,23 @@ export enum OrderAction {
|
||||
/**
|
||||
* Review.
|
||||
*/
|
||||
REVIEW
|
||||
REVIEW,
|
||||
/**
|
||||
* Customer Service.
|
||||
*/
|
||||
CUSTOMER_SERVICE
|
||||
}
|
||||
|
||||
/**
|
||||
* List of possible types of order rejection.
|
||||
* @deprecated Use {@link TransactionValues.ReasonType} instead.
|
||||
*/
|
||||
export enum RejectionType {
|
||||
export type RejectionType = ReasonType;
|
||||
|
||||
/**
|
||||
* List of possible types of order rejection.
|
||||
*/
|
||||
export enum ReasonType {
|
||||
/**
|
||||
* Unknown
|
||||
*/
|
||||
@@ -494,8 +554,14 @@ export enum ResultType {
|
||||
|
||||
/**
|
||||
* List of possible user decisions to give delivery address.
|
||||
* @deprecated Use {@link TransactionValues.DeliveryAddressUserDecision} instead.
|
||||
*/
|
||||
export enum DeliveryAddressDecision {
|
||||
export type DeliveryAddressDecision = DeliveryAddressUserDecision;
|
||||
|
||||
/**
|
||||
* List of possible user decisions to give delivery address.
|
||||
*/
|
||||
export enum DeliveryAddressUserDecision {
|
||||
/**
|
||||
* Unknown.
|
||||
*/
|
||||
@@ -512,8 +578,14 @@ export enum DeliveryAddressDecision {
|
||||
|
||||
/**
|
||||
* List of possible order location types.
|
||||
* @deprecated Use {@link TransactionValues.OrderLocationType} instead.
|
||||
*/
|
||||
export enum LocationType {
|
||||
export type LocationType = OrderLocationType;
|
||||
|
||||
/**
|
||||
* List of possible order location types.
|
||||
*/
|
||||
export enum OrderLocationType {
|
||||
/**
|
||||
* Unknown.
|
||||
*/
|
||||
@@ -533,7 +605,11 @@ export enum LocationType {
|
||||
/**
|
||||
* Destination of the order.
|
||||
*/
|
||||
DESTINATION
|
||||
DESTINATION,
|
||||
/**
|
||||
* Pick up location of the order.
|
||||
*/
|
||||
PICK_UP
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -558,6 +634,20 @@ export enum TimeType {
|
||||
RESERVATION_SLOT
|
||||
}
|
||||
|
||||
/**
|
||||
* List of possible tokenization types for the payment method
|
||||
*/
|
||||
export enum PaymentMethodTokenizationType {
|
||||
/**
|
||||
* Unspecified tokenization type.
|
||||
*/
|
||||
UNSPECIFIED_TOKENIZATION_TYPE,
|
||||
/**
|
||||
* Use external payment gateway tokenization API to tokenize selected payment method.
|
||||
*/
|
||||
PAYMENT_GATEWAY
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for initializing and constructing Order with chainable interface.
|
||||
*/
|
||||
@@ -655,11 +745,11 @@ export class Order {
|
||||
/**
|
||||
* Adds an associated location to the order. Up to 2 locations can be added.
|
||||
*
|
||||
* @param type One of TransactionValues.LocationType.
|
||||
* @param type One of TransactionValues.OrderLocationType.
|
||||
* @param location Location to add.
|
||||
* @return Returns current constructed Order.
|
||||
*/
|
||||
addLocation(type: LocationType, location: Location): Order;
|
||||
addLocation(type: OrderLocationType, location: Location): Order;
|
||||
|
||||
/**
|
||||
* Sets an associated time to the order.
|
||||
@@ -780,9 +870,9 @@ export class LineItem {
|
||||
image?: Image;
|
||||
|
||||
/**
|
||||
* Type of the item. One of TransactionValues.ItemType.
|
||||
* Type of the item. One of TransactionValues.LineItemType.
|
||||
*/
|
||||
type?: ItemType;
|
||||
type?: LineItemType;
|
||||
|
||||
/**
|
||||
* Quantity of the item.
|
||||
@@ -834,10 +924,10 @@ export class LineItem {
|
||||
/**
|
||||
* Set the type of the item.
|
||||
*
|
||||
* @param type Type of the item. One of TransactionValues.ItemType.
|
||||
* @param type Type of the item. One of TransactionValues.LineItemType.
|
||||
* @return Returns current constructed LineItem.
|
||||
*/
|
||||
setType(type: ItemType): LineItem;
|
||||
setType(type: LineItemType): LineItem;
|
||||
|
||||
/**
|
||||
* Set the quantity of the item.
|
||||
@@ -898,9 +988,9 @@ export class OrderUpdate {
|
||||
lineItemUpdates: object;
|
||||
|
||||
/**
|
||||
* UTC timestamp of the order update.
|
||||
* UTC timestamp of the order update as an RFC 3339 string.
|
||||
*/
|
||||
updateTime?: object;
|
||||
updateTime?: string;
|
||||
|
||||
/**
|
||||
* Actionable items presented to the user to manage the order.
|
||||
@@ -946,7 +1036,7 @@ export class OrderUpdate {
|
||||
* Set the update time of the order.
|
||||
*
|
||||
* @param seconds Seconds since Unix epoch.
|
||||
* @param nanos Partial time units.
|
||||
* @param nanos Partial time units. It is rounded to the nearest millisecond.
|
||||
* @return Returns current constructed OrderUpdate.
|
||||
*/
|
||||
setUpdateTime(seconds: number, nanos?: number): OrderUpdate;
|
||||
@@ -974,12 +1064,12 @@ export class OrderUpdate {
|
||||
/**
|
||||
* Adds an actionable item for the user to manage the order.
|
||||
*
|
||||
* @param type One of TransactionValues.OrderActions.
|
||||
* @param type One of TransactionValues.ActionType.
|
||||
* @param label Button label.
|
||||
* @param url URL to open when button is clicked.
|
||||
* @return Returns current constructed OrderUpdate.
|
||||
*/
|
||||
addOrderManagementAction(type: OrderAction, label: string, url: string): OrderUpdate;
|
||||
addOrderManagementAction(type: ActionType, label: string, url: string): OrderUpdate;
|
||||
|
||||
/**
|
||||
* Adds a single price update for a particular line item in the order.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Global
|
||||
|
||||
const threeCamera = new AFRAME.THREE.Camera();
|
||||
AFRAME.TWEEN.Easing;
|
||||
|
||||
@@ -42,9 +41,18 @@ entity.addEventListener('child-detached', (event) => {
|
||||
const Component = AFRAME.registerComponent('test', {});
|
||||
|
||||
// Scene
|
||||
|
||||
const scene = document.querySelector('a-scene');
|
||||
scene.hasLoaded;
|
||||
|
||||
// System
|
||||
const system = scene.systems['systemName'];
|
||||
|
||||
// Register Custom Geometry
|
||||
AFRAME.registerGeometry('a-test-geometry', {
|
||||
schema: {
|
||||
groupIndex: { default: 0 }
|
||||
},
|
||||
init(data) {
|
||||
this.geometry = new THREE.Geometry();
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+9
-4
@@ -1,6 +1,7 @@
|
||||
// Type definitions for AFRAME 0.5
|
||||
// Type definitions for AFRAME 0.7
|
||||
// Project: https://aframe.io/
|
||||
// Definitions by: Paul Shannon <https://github.com/devpaul>
|
||||
// Roberto Ritger <https://github.com/bertoritger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -40,7 +41,7 @@ declare namespace AFrame {
|
||||
primitives: { [ key: string ]: Entity };
|
||||
registerComponent(name: string, component: ComponentDefinition): ComponentConstructor;
|
||||
registerElement(name: string, element: ANode): void;
|
||||
registerGeometry(name: string, geometery: THREE.Geometry): Geometry;
|
||||
registerGeometry(name: string, geometry: GeometryDefinition): Geometry;
|
||||
registerPrimitive(name: string, primitive: PrimitiveDefinition): void;
|
||||
registerShader(name: string, shader: any): void;
|
||||
registerSystem(name: string, definition: SystemDefinition): void;
|
||||
@@ -101,7 +102,7 @@ declare namespace AFrame {
|
||||
name: string;
|
||||
schema: Schema;
|
||||
|
||||
init(): void;
|
||||
init(data?: any): void;
|
||||
pause(): void;
|
||||
play(): void;
|
||||
remove(): void;
|
||||
@@ -124,7 +125,7 @@ declare namespace AFrame {
|
||||
multiple?: boolean;
|
||||
schema?: Schema;
|
||||
|
||||
init?(): void;
|
||||
init?(data?: any): void;
|
||||
pause?(): void;
|
||||
play?(): void;
|
||||
remove?(): void;
|
||||
@@ -222,6 +223,10 @@ declare namespace AFrame {
|
||||
[ key: string ]: any;
|
||||
}
|
||||
|
||||
interface GeometryDefinition extends ComponentDefinition {
|
||||
geometry?: THREE.Geometry;
|
||||
}
|
||||
|
||||
interface GeometryDescriptor {
|
||||
Geometry: Geometry;
|
||||
schema: Schema;
|
||||
|
||||
Vendored
+208
-45
@@ -2191,27 +2191,45 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
chart.addGraph(graph);
|
||||
*/
|
||||
class AmGraph {
|
||||
/** Text which screen readers will read if user rolls-over the bullet/column or sets focus using tab key (this is possible only if tabIndex property of AmGraph is set to some number). Text is added as aria-label tag. Note - not all screen readers and browsers support this.
|
||||
@default "[[title]] [[category]] [[value]]"
|
||||
*/
|
||||
accessibleLabel: string;
|
||||
/** Name of the alpha field in your dataProvider. */
|
||||
alphaField: string;
|
||||
/** If you set this to true before chart is drawn, the animation of this graph won't be played.
|
||||
@default false
|
||||
*/
|
||||
animationPlayed: boolean;
|
||||
/** Allows customizing graphs balloons individually (only when ChartCursor is used). Note: the balloon object is not created automatically, you should create it before setting properties */
|
||||
balloon: AmBalloon;
|
||||
/** Value balloon color. Will use graph or data item color if not set. */
|
||||
balloonColor: string;
|
||||
/** If you set some function, the graph will call it and pass GraphDataItem and AmGraph object to it. This function should return a string which will be displayed in a balloon. */
|
||||
/** If you set some function, the graph will call it and pass GraphDataItem and AmGraph objects to it. This function should return a string which will be displayed in a balloon. */
|
||||
balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string;
|
||||
/** Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] [[value]] */
|
||||
/** Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] or any other field name from your data provider. HTML tags can also be used.
|
||||
@default [[value]]
|
||||
*/
|
||||
balloonText: string;
|
||||
/** Specifies if the line graph should be placed behind column graphs */
|
||||
/** Specifies if the line graph should be placed behind column graphs
|
||||
@default false
|
||||
*/
|
||||
behindColumns: boolean;
|
||||
/** Type of the bullets. Possible values are: "none", "round", "square", "triangleUp", "triangleDown", "bubble", "custom". none */
|
||||
/** Type of the bullets. Possible values are: "none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond", "xError", "yError" and "custom".
|
||||
@default "none"
|
||||
*/
|
||||
bullet: string;
|
||||
/** Opacity of bullets. Value range is 0 - 1.
|
||||
@default 1
|
||||
*/
|
||||
bulletAlpha: number;
|
||||
/** bulletAxis value is used when you are building error chart. Error chart is a regular serial or XY chart with bullet type set to "xError" or "yError". The graph should know which axis should be used to determine the size of this bullet - that's when bulletAxis should be set. Besides that, you should also set graph.errorField. You can also use other bullet types with this feature too. For example, if you set bulletAxis for XY chart, the size of a bullet will change as you zoom the chart. */
|
||||
bulletAxis: ValueAxis;
|
||||
/** Bullet border opacity.
|
||||
@default 1
|
||||
@default 0
|
||||
*/
|
||||
bulletBorderAlpha: number;
|
||||
/** Bullet border color. Will use lineColor if not set. */
|
||||
/** Bullet border color. Will use lineColor if not set. */
|
||||
bulletBorderColor: string;
|
||||
/** Bullet border thickness.
|
||||
@default 2
|
||||
@@ -2221,7 +2239,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
bulletColor: string;
|
||||
/** Name of the bullet field in your dataProvider. */
|
||||
bulletField: string;
|
||||
/** Bullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns. */
|
||||
/** Useful for touch devices - if you set it to 20 or so, the bullets of a graph will have invisible circle around the actual bullet (bullets should still be enabled), which will be easier to touch (bullets usually are smaller and hard to hit). */
|
||||
bulletHitAreaSize: number;
|
||||
/** Bullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns.
|
||||
@default 0
|
||||
*/
|
||||
bulletOffset: number;
|
||||
/** Bullet size.
|
||||
@default 8
|
||||
@@ -2229,17 +2251,31 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
bulletSize: number;
|
||||
/** Name of the bullet size field in your dataProvider. */
|
||||
bulletSizeField: string;
|
||||
/** If this field is set and addClassNames is enabled, the chart will look for a class name string in data using this setting and apply additional class names to elements of the particular data points, such as bullets. */
|
||||
classNameField: string;
|
||||
/** Name of the close field (used by candlesticks and ohlc) in your dataProvider. */
|
||||
closeField: string;
|
||||
/** In case you want to place this graph's columns in front of other columns, set this to false. In case "true", the columns will be clustered next to each other.
|
||||
|
||||
NOTE: clustering works only for graphs of type "column".
|
||||
@default true
|
||||
*/
|
||||
clustered: boolean;
|
||||
/** Color of value labels. Will use chart's color if not set. */
|
||||
color: string;
|
||||
/** Name of the color field in your dataProvider. */
|
||||
colorField: string;
|
||||
/** Specifies whether to connect data points if data is missing. The default value is true.
|
||||
/** You can use this property with non-stacked column graphs and specify order of columns of each category (starting from 0). Important: this feature does not work in stacked columns scenarios as well as with graph toggling enabled in legend. */
|
||||
columnIndexField: string;
|
||||
/** You can specify custom column width for each graph individually. Value range is 0 - 1 (we set relative width, not pixel width here). */
|
||||
columnWidth: number;
|
||||
/** Specifies whether to connect data points if data is missing. The default value is true. This feature does not work with XY chart.
|
||||
@default true
|
||||
*/
|
||||
connect: boolean;
|
||||
/** Corner radius of column. It can be set both in pixels or in percents. The chart's depth and angle styles must be set to 0. The default value is 0. Note, cornerRadiusTop will be applied for all corners of the column, JavaScript charts do not have a possibility to set separate corner radius for top and bottom. As we want all the property names to be the same both on JS and Flex, we didn't change this too. */
|
||||
/** Corner radius of column. It can be set both in pixels or in percents. The chart's depth and angle styles must be set to 0. The default value is 0. Note, cornerRadiusTop will be applied for all corners of the column, JavaScript charts do not have a possibility to set separate corner radius for top and bottom. As we want all the property names to be the same both on JS and Flex, we didn't change this too.
|
||||
@default 0
|
||||
*/
|
||||
cornerRadiusTop: number;
|
||||
/** If bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor. You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph, set opacity to 0.
|
||||
@default 1
|
||||
@@ -2249,55 +2285,108 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
customBullet: string;
|
||||
/** Name of the custom bullet field in your dataProvider. */
|
||||
customBulletField: string;
|
||||
/** Dash length. If you set it to a value greater than 0, the graph line will be dashed. */
|
||||
/** Path to the image for legend marker. */
|
||||
customMarker: string;
|
||||
/** Dash length. If you set it to a value greater than 0, the graph line (or columns border) will be dashed.
|
||||
@default 0
|
||||
*/
|
||||
dashLength: number;
|
||||
/** Name of the dash length field in your dataProvider. This property adds a possibility to change graphs’ line from solid to dashed on any data point. You can also make columns border dashed using this setting. Note, this won't work with smoothedLineGraph. */
|
||||
dashLengthField: string;
|
||||
/** Used to format balloons if value axis is date-based.
|
||||
@default "MMM DD, YYYY"
|
||||
*/
|
||||
dateFormat: string;
|
||||
/** Name of the description field in your dataProvider. */
|
||||
descriptionField: string;
|
||||
/** Opacity of fill. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used. */
|
||||
/** Name of error value field in your data provider. */
|
||||
errorField: string;
|
||||
/** Opacity of fill. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used.
|
||||
@default 0
|
||||
*/
|
||||
fillAlphas: number;
|
||||
/** Fill color. Will use lineColor if not set. */
|
||||
fillColors: any;
|
||||
/** Name of the fill colors field in your dataProvider. */
|
||||
/** Fill color. Will use lineColor if not set. You can also set array of colors here. */
|
||||
fillColors: string;
|
||||
/** Name of the fill colors field in your dataProvider. This property adds a possibility to change line graphs’ fill color on any data point to create highlighted sections of the graph. Works only with AmSerialChart. */
|
||||
fillColorsField: string;
|
||||
/** You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis). */
|
||||
/** XY chart only. If you set this property to id or reference of your X or Y axis, and the fillAlphas is > 0, the area between graph and axis will be filled with color, like in this demo. */
|
||||
fillToAxis: ValueAxis;
|
||||
/** You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis). This feature is not supported by smoothedLine graphs and Radar chart. */
|
||||
fillToGraph: AmGraph;
|
||||
/** Column width in pixels. If you set this property, columns will be of a fixed width and won't adjust to the available space. */
|
||||
fixedColumnWidth: number;
|
||||
/** Size of value labels text. Will use chart's fontSize if not set. */
|
||||
fontSize: string;
|
||||
/** Orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal". vertical */
|
||||
fontSize: number;
|
||||
/** If this is set `true`, the graph will always break the line if the distance in time between two adjacent data points is bigger than `gapPeriod x minPeriod`, even if `connect` is set to `true`.
|
||||
@default false
|
||||
*/
|
||||
forceGap: boolean;
|
||||
/** Name of the gap field in your dataProvider. You can force graph to show gap at a desired data point using this feature. This feature does not work with XY chart. */
|
||||
gapField: string;
|
||||
/** Using this property you can specify when graph should display gap - if the time difference between data points is bigger than duration of minPeriod * gapPeriod, and connect property of a graph is set to false, graph will display gap.
|
||||
@default 1.1
|
||||
*/
|
||||
gapPeriod: number;
|
||||
/** Orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal".
|
||||
@default "vertical"
|
||||
*/
|
||||
gradientOrientation: string;
|
||||
/** Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead. */
|
||||
/** Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead.
|
||||
@default false
|
||||
*/
|
||||
hidden: boolean;
|
||||
/** If there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible. */
|
||||
/** If there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible.
|
||||
@default 0
|
||||
*/
|
||||
hideBulletsCount: number;
|
||||
/** Name of the high field (used by candlesticks and ohlc) in your dataProvider. */
|
||||
highField: string;
|
||||
|
||||
/** Unique id of a graph. It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need to indicate which graph should be used.*/
|
||||
id?: string;
|
||||
|
||||
/** Unique id of a graph. It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need to indicate which graph should be used. */
|
||||
id: string;
|
||||
/** Whether to include this graph when calculating min and max value of the axis.
|
||||
@default true
|
||||
*/
|
||||
includeInMinMax: boolean;
|
||||
/** Data label text anchor.
|
||||
@default "auto"
|
||||
*/
|
||||
labelAnchor: string;
|
||||
/** Name of label color field in data provider. */
|
||||
labelColorField: string;
|
||||
/** Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". Sometimes position is changed by the chart, depending on a graph type, rotation, etc. top */
|
||||
/** You can use it to format labels of data items in any way you want. Graph will call this function and pass reference to GraphDataItem and formatted text as attributes. This function should return string which will be displayed as label. */
|
||||
labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string;
|
||||
labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string;
|
||||
/** Offset of data label.
|
||||
@default 0
|
||||
*/
|
||||
labelOffset: number;
|
||||
/** Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". Sometimes position is changed by the chart, depending on a graph type, rotation, etc.
|
||||
@default "top"
|
||||
*/
|
||||
labelPosition: string;
|
||||
/** Rotation of a data label.
|
||||
@default 0
|
||||
*/
|
||||
labelRotation: number;
|
||||
/** Value label text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]]. */
|
||||
labelText: string;
|
||||
/** Legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1. */
|
||||
legendAlpha: number;
|
||||
/** Legend marker color. Will use lineColor if not set. */
|
||||
legendColor: string;
|
||||
/** It is called and the following attributes are passed: dataItem, formattedText, periodValues, periodPercentValues. It should return hex color code which will be used for legend marker. */
|
||||
legendColorFunction: Object;
|
||||
/** The text which will be displayed in the value portion of the legend when user is not hovering above any data point. The tags should be made out of two parts - the name of a field (value / open / close / high / low) and the value of the period you want to be show - open / close / high / low / sum / average / count. For example: [[value.sum]] means that sum of all data points of value field in the selected period will be displayed. */
|
||||
legendPeriodValueText: string;
|
||||
/** Legend value text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] You can also use custom fields from your dataProvider. If not set, uses Legend's valueText. */
|
||||
legendValueText: string;
|
||||
/** Opacity of the line (or column border). Value range is 0 - 1.
|
||||
@default 1
|
||||
*/
|
||||
lineAlpha: number;
|
||||
/** Color of the line (or column border). If you do not set any, the color from [[AmCoordinateChart */
|
||||
/** Color of the line (or column border). If you do not set any, the color from AmCoordinateChart.colors array will be used for each subsequent graph. */
|
||||
lineColor: string;
|
||||
/** Name of the line color field (used by columns and candlesticks only) in your dataProvider. */
|
||||
/** Name of the line color field in your dataProvider. This property adds a possibility to change graphs’ line color on any data point to create highlighted sections of the graph. Works only with AmSerialChart. */
|
||||
lineColorField: string;
|
||||
/** Specifies thickness of the graph line (or column border).
|
||||
@default 1
|
||||
@@ -2305,55 +2394,125 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
lineThickness: number;
|
||||
/** Name of the low field (used by candlesticks and ohlc) in your dataProvider. */
|
||||
lowField: string;
|
||||
/** Legend marker type. You can set legend marker (key) type for individual graphs. Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble". */
|
||||
/** Legend marker type. You can set legend marker (key) type for individual graphs. Possible values are: square, circle, diamond, triangleUp, triangleDown, triangleLeft, triangleDown, bubble, line, none. */
|
||||
markerType: string;
|
||||
/** Specifies size of the bullet which value is the biggest (XY chart).
|
||||
@default 50
|
||||
*/
|
||||
maxBulletSize: number;
|
||||
/** Specifies minimum size of the bullet (XY chart). */
|
||||
/** Specifies minimum size of the bullet (XY chart).
|
||||
@default 4
|
||||
*/
|
||||
minBulletSize: number;
|
||||
/** If you use different colors for your negative values, a graph below zero line is filled with negativeColor. With this property you can define a different base value at which colors should be changed to negative colors. */
|
||||
/** It is useful if you have really lots of data points. Based on this property the graph will omit some of the lines (if the distance between points is less that minDistance, in pixels). This will not affect the bullets or indicator in anyway, so the user will not see any difference (unless you set minValue to a bigger value, let say 5), but will increase performance as less lines will be drawn. By setting value to a bigger number you can also make your lines look less jagged.
|
||||
@default 1
|
||||
*/
|
||||
minDistance: number;
|
||||
/** If you use different colors for your negative values, a graph below zero line is filled with negativeColor. With this property you can define a different base value at which colors should be changed to negative colors.
|
||||
@default 0
|
||||
*/
|
||||
negativeBase: number;
|
||||
/** Fill opacity of negative part of the graph. Will use fillAlphas if not set. */
|
||||
negativeFillAlphas: number;
|
||||
/** Fill color of negative part of the graph. Will use fillColors if not set. */
|
||||
negativeFillColors: any; //String /Array;
|
||||
negativeFillColors: string;
|
||||
/** Opacity of the negative portion of the line (or column border). Value range is 0 - 1.
|
||||
@default 1
|
||||
*/
|
||||
negativeLineAlpha: number;
|
||||
/** Color of the line (or column) when the values are negative. In case the graph type is candlestick or ohlc, negativeLineColor is used when close value is less then open value. */
|
||||
negativeLineColor: string;
|
||||
/** Example: {precision:-1, decimalSeparator:'.', thousandsSeparator:','}. The graph uses this object's values to format the numbers. Uses chart's numberFormatter if not defined. */
|
||||
numberFormatter: Object;
|
||||
/** If you set it to true, column chart will begin new stack. This allows having Clustered and Stacked column/bar chart. */
|
||||
newStack: boolean;
|
||||
/** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.
|
||||
@default 50
|
||||
/** If you set it to true, column chart will begin new stack. This allows having Clustered and Stacked column/bar chart.
|
||||
@default false
|
||||
*/
|
||||
newStack: boolean;
|
||||
/** In case you want to have a step line graph without risers, you should set this to true.
|
||||
@default false
|
||||
*/
|
||||
noStepRisers: boolean;
|
||||
/** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */
|
||||
openField: string;
|
||||
/**Precision of values. Will use chart's precision if not set any.*/
|
||||
precision: number;
|
||||
/** Specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start" and "middle". middle */
|
||||
/** Value of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX and randomY values. For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. If you want to have individual patterns for each column, define patterns in data provider and set graph.patternField property. Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work with IE8 and older. 3D bar/Pie charts won't work properly with patterns. */
|
||||
pattern: Object;
|
||||
/** Field name in your data provider which holds pattern information. Value of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX and randomY values. For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work with IE8 and older. 3D bar/Pie charts won't work properly with patterns. */
|
||||
patternField: string;
|
||||
/** This property can be used by step graphs - you can set how many periods one horizontal line should span.
|
||||
@default 1
|
||||
*/
|
||||
periodSpan: number;
|
||||
/** Specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start", "middle" and "end"
|
||||
@default "middle"
|
||||
*/
|
||||
pointPosition: string;
|
||||
/** If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true. */
|
||||
/** Precision of values. Will use chart's precision if not set any. */
|
||||
precision: number;
|
||||
/** If this is set to true, candlesticks will be colored in a different manner - if current close is less than current open, the candlestick will be empty, otherwise - filled with color. If previous close is less than current close, the candlestick will use positive color, otherwise - negative color.
|
||||
@default false
|
||||
*/
|
||||
proCandlesticks: boolean;
|
||||
/** Gantt chart only. Contains unmodified segment object from data provider. */
|
||||
segmentData: Object;
|
||||
/** If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space or go outside plot area. If you don't want these labels to be hidden, set this to true.
|
||||
@default false
|
||||
*/
|
||||
showAllValueLabels: boolean;
|
||||
/** Specifies whether the value balloon of this graph is shown when mouse is over data item or chart's indicator is over some series.
|
||||
@default true
|
||||
*/
|
||||
showBalloon: boolean;
|
||||
/** Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, also if column chart has "open" value. Possible values are: "open", "close", "high", "low". close */
|
||||
/** Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, also if column chart has "open" value. Possible values are: "open", "close", "high", "low". "top" and "bottom" values will glue the balloon to top/bottom of the plot area.
|
||||
@default "close"
|
||||
*/
|
||||
showBalloonAt: string;
|
||||
/** Works with candlestick graph type, you can set it to open, close, high, low. If you set it to high, the events will be shown at the tip of the high line.
|
||||
@default "close"
|
||||
*/
|
||||
showBulletsAt: string;
|
||||
/** If you want mouse pointer to change to hand when hovering the graph, set this property to true.
|
||||
@default false
|
||||
*/
|
||||
showHandOnHover: boolean;
|
||||
/** It can only be used together with topRadius (when columns look like cylinders). If you set it to true, the cylinder will be lowered down so that the center of it's bottom circle would be right on category axis.
|
||||
@default false
|
||||
*/
|
||||
showOnAxis: boolean;
|
||||
/** If the value axis of this graph has stack types like "regular" or "100%" You can exclude this graph from stacking.
|
||||
@default true
|
||||
*/
|
||||
stackable: boolean;
|
||||
/** Step graph only. Specifies to which direction step should be drawn.
|
||||
@default "right"
|
||||
*/
|
||||
stepDirection: string;
|
||||
/** If you set it to false, the graph will not be hidden when user clicks on legend entry.
|
||||
@default true
|
||||
*/
|
||||
switchable: boolean;
|
||||
/** In case you set it to some number, the chart will set focus on bullet/column (starting from first) when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label which is set using accessibleLabel property of AmGraph. Note, not all browsers and readers support this. */
|
||||
tabIndex: number;
|
||||
/** Graph title. */
|
||||
title: string;
|
||||
/** Type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs. line */
|
||||
/** If you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to >0 values in order this to be visible). you can make columns look like cones (set topRadius to 0) or even like some glasses (set to bigger than 1). We strongly recommend setting grid opacity to 0 in order this to look good. */
|
||||
topRadius: number;
|
||||
/** Type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs.
|
||||
@default "line"
|
||||
*/
|
||||
type: string;
|
||||
/** Name of the url field in your dataProvider. */
|
||||
urlField: string;
|
||||
/** Target to open URLs in, i.e. _blank, _top, etc. */
|
||||
urlTarget: string;
|
||||
/** Specifies which value axis the graph will use. Will use the first value axis if not set. */
|
||||
/** If set to true, the bullet border will take the same color as graph line.
|
||||
@default false
|
||||
*/
|
||||
useLineColorForBulletBorder: boolean;
|
||||
/** If negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true (default is false), the line, step and column graphs will use these colors for lines, bullets or columns if previous value is bigger than current value. In case you set openField for the graph, the graph will compare current value with openField value instead of comparing to previous value. Here is a demo.
|
||||
@default false
|
||||
*/
|
||||
useNegativeColorIfDown: boolean;
|
||||
/** Specifies which value axis the graph will use. Will use the first value axis if not set. You can use reference to the real ValueAxis object or set value axis id.
|
||||
@default ValueAxis
|
||||
*/
|
||||
valueAxis: ValueAxis;
|
||||
/** Name of the value field in your dataProvider. */
|
||||
valueField: string;
|
||||
@@ -2361,11 +2520,15 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
@default true
|
||||
*/
|
||||
visibleInLegend: boolean;
|
||||
/** XY chart only. A horizontal value axis object to attach graph to. */
|
||||
/** XY chart only. A horizontal value axis object to attach graph to.
|
||||
@default ValueAxis
|
||||
*/
|
||||
xAxis: ValueAxis;
|
||||
/** XY chart only. Name of the x field in your dataProvider. */
|
||||
xField: string;
|
||||
/** XY chart only. A vertical value axis object to attach graph to. */
|
||||
/** XY chart only. A vertical value axis object to attach graph to.
|
||||
@default ValueAxis
|
||||
*/
|
||||
yAxis: ValueAxis;
|
||||
/** XY chart only. Name of the y field in your dataProvider. */
|
||||
yField: string;
|
||||
|
||||
Vendored
+1
-1
@@ -63,4 +63,4 @@ export interface ConfirmChannel extends Channel {
|
||||
waitForConfirms(): Promise<void>;
|
||||
}
|
||||
|
||||
export function connect(url: string, socketOptions?: any): Promise<Connection>;
|
||||
export function connect(url: string | Options.Connect, socketOptions?: any): Promise<Connection>;
|
||||
|
||||
Vendored
+59
-1
@@ -21,6 +21,64 @@ export namespace Replies {
|
||||
}
|
||||
|
||||
export namespace Options {
|
||||
interface Connect {
|
||||
/**
|
||||
* The to be used protocol
|
||||
*
|
||||
* Default value: 'amqp'
|
||||
*/
|
||||
protocol?: string;
|
||||
/**
|
||||
* Hostname used for connecting to the server.
|
||||
*
|
||||
* Default value: 'localhost'
|
||||
*/
|
||||
hostname?: string;
|
||||
/**
|
||||
* Port used for connecting to the server.
|
||||
*
|
||||
* Default value: 5672
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Username used for authenticating against the server.
|
||||
*
|
||||
* Default value: 'guest'
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* Password used for authenticating against the server.
|
||||
*
|
||||
* Default value: 'guest'
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* The desired locale for error messages. RabbitMQ only ever uses en_US
|
||||
*
|
||||
* Default value: 'en_US'
|
||||
*/
|
||||
locale?: string;
|
||||
/**
|
||||
* The size in bytes of the maximum frame allowed over the connection. 0 means
|
||||
* no limit (but since frames have a size field which is an unsigned 32 bit integer, it’s perforce 2^32 - 1).
|
||||
*
|
||||
* Default value: 0x1000 (4kb) - That's the allowed minimum, it will fit many purposes
|
||||
*/
|
||||
frameMax?: number;
|
||||
/**
|
||||
* The period of the connection heartbeat in seconds.
|
||||
*
|
||||
* Default value: 0
|
||||
*/
|
||||
heartbeat?: number;
|
||||
/**
|
||||
* What VHost shall be used.
|
||||
*
|
||||
* Default value: '/'
|
||||
*/
|
||||
vhost?: string;
|
||||
}
|
||||
|
||||
interface AssertQueue {
|
||||
exclusive?: boolean;
|
||||
durable?: boolean;
|
||||
@@ -85,4 +143,4 @@ export interface Message {
|
||||
content: Buffer;
|
||||
fields: any;
|
||||
properties: any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material.
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().initialValue('Buddy'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().required(true));
|
||||
};
|
||||
$scope['prerenderedDialog'] = () => {
|
||||
$mdDialog.show({
|
||||
template: '<md-dialog>Hello!</md-dialog>',
|
||||
|
||||
Vendored
+1
@@ -80,6 +80,7 @@ declare module 'angular' {
|
||||
|
||||
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
|
||||
cancel(cancel: string): IPromptDialog;
|
||||
required(required: boolean): IPromptDialog; // default: false
|
||||
placeholder(placeholder: string): IPromptDialog;
|
||||
initialValue(initialValue: string): IPromptDialog;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@ declare var $sanitizeService: ng.sanitize.ISanitizeService;
|
||||
shouldBeString = $sanitizeService(shouldBeString);
|
||||
|
||||
declare var $linky: ng.sanitize.filter.ILinky;
|
||||
shouldBeString = $linky(shouldBeString);
|
||||
shouldBeString = $linky(shouldBeString, "target");
|
||||
shouldBeString = $linky(shouldBeString, shouldBeString);
|
||||
|
||||
Vendored
+1
-1
@@ -36,7 +36,7 @@ declare module 'angular' {
|
||||
* see https://docs.angularjs.org/api/ngSanitize/filter/linky
|
||||
*/
|
||||
interface ILinky {
|
||||
(text: string, target: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string;
|
||||
(text: string, target?: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -777,7 +777,7 @@ declare module Microsoft.ApplicationInsights {
|
||||
* @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.
|
||||
* @param accountId {string} - An optional string to represent the account associated with the authenticated user.
|
||||
*/
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): any;
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie?: boolean): any;
|
||||
/**
|
||||
* Clears the authenticated user id and the account id from the user context.
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -5265,7 +5265,7 @@ export interface CursorPositionChangedEvent {
|
||||
newBufferPosition: Point;
|
||||
newScreenPosition: Point;
|
||||
textChanged: boolean;
|
||||
Cursor: Cursor;
|
||||
cursor: Cursor;
|
||||
}
|
||||
|
||||
export interface DecorationPropsChangedEvent {
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for AutobahnJS v0.9.7
|
||||
// Project: http://autobahn.ws/js/
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Wladimir Totino <https://github.com/valepu>
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Wladimir Totino <https://github.com/valepu>, Mathias Teier <https://github.com/glenroy37/,http://kagent.at>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="when" />
|
||||
@@ -179,6 +179,7 @@ declare namespace autobahn {
|
||||
|
||||
interface ISubscribeOptions {
|
||||
match?: string;
|
||||
get_retained?: boolean;
|
||||
}
|
||||
|
||||
interface IRegisterOptions {
|
||||
|
||||
Vendored
+178
-178
@@ -600,185 +600,185 @@ export class NodePath<T = Node> {
|
||||
addComments(type: string, comments: any[]): void;
|
||||
|
||||
// ------------------------- isXXX -------------------------
|
||||
isArrayExpression(opts?: object): boolean;
|
||||
isAssignmentExpression(opts?: object): boolean;
|
||||
isBinaryExpression(opts?: object): boolean;
|
||||
isDirective(opts?: object): boolean;
|
||||
isDirectiveLiteral(opts?: object): boolean;
|
||||
isBlockStatement(opts?: object): boolean;
|
||||
isBreakStatement(opts?: object): boolean;
|
||||
isCallExpression(opts?: object): boolean;
|
||||
isCatchClause(opts?: object): boolean;
|
||||
isConditionalExpression(opts?: object): boolean;
|
||||
isContinueStatement(opts?: object): boolean;
|
||||
isDebuggerStatement(opts?: object): boolean;
|
||||
isDoWhileStatement(opts?: object): boolean;
|
||||
isEmptyStatement(opts?: object): boolean;
|
||||
isExpressionStatement(opts?: object): boolean;
|
||||
isFile(opts?: object): boolean;
|
||||
isForInStatement(opts?: object): boolean;
|
||||
isForStatement(opts?: object): boolean;
|
||||
isFunctionDeclaration(opts?: object): boolean;
|
||||
isFunctionExpression(opts?: object): boolean;
|
||||
isIdentifier(opts?: object): boolean;
|
||||
isIfStatement(opts?: object): boolean;
|
||||
isLabeledStatement(opts?: object): boolean;
|
||||
isStringLiteral(opts?: object): boolean;
|
||||
isNumericLiteral(opts?: object): boolean;
|
||||
isNullLiteral(opts?: object): boolean;
|
||||
isBooleanLiteral(opts?: object): boolean;
|
||||
isRegExpLiteral(opts?: object): boolean;
|
||||
isLogicalExpression(opts?: object): boolean;
|
||||
isMemberExpression(opts?: object): boolean;
|
||||
isNewExpression(opts?: object): boolean;
|
||||
isProgram(opts?: object): boolean;
|
||||
isObjectExpression(opts?: object): boolean;
|
||||
isObjectMethod(opts?: object): boolean;
|
||||
isObjectProperty(opts?: object): boolean;
|
||||
isRestElement(opts?: object): boolean;
|
||||
isReturnStatement(opts?: object): boolean;
|
||||
isSequenceExpression(opts?: object): boolean;
|
||||
isSwitchCase(opts?: object): boolean;
|
||||
isSwitchStatement(opts?: object): boolean;
|
||||
isThisExpression(opts?: object): boolean;
|
||||
isThrowStatement(opts?: object): boolean;
|
||||
isTryStatement(opts?: object): boolean;
|
||||
isUnaryExpression(opts?: object): boolean;
|
||||
isUpdateExpression(opts?: object): boolean;
|
||||
isVariableDeclaration(opts?: object): boolean;
|
||||
isVariableDeclarator(opts?: object): boolean;
|
||||
isWhileStatement(opts?: object): boolean;
|
||||
isWithStatement(opts?: object): boolean;
|
||||
isAssignmentPattern(opts?: object): boolean;
|
||||
isArrayPattern(opts?: object): boolean;
|
||||
isArrowFunctionExpression(opts?: object): boolean;
|
||||
isClassBody(opts?: object): boolean;
|
||||
isClassDeclaration(opts?: object): boolean;
|
||||
isClassExpression(opts?: object): boolean;
|
||||
isExportAllDeclaration(opts?: object): boolean;
|
||||
isExportDefaultDeclaration(opts?: object): boolean;
|
||||
isExportNamedDeclaration(opts?: object): boolean;
|
||||
isExportSpecifier(opts?: object): boolean;
|
||||
isForOfStatement(opts?: object): boolean;
|
||||
isImportDeclaration(opts?: object): boolean;
|
||||
isImportDefaultSpecifier(opts?: object): boolean;
|
||||
isImportNamespaceSpecifier(opts?: object): boolean;
|
||||
isImportSpecifier(opts?: object): boolean;
|
||||
isMetaProperty(opts?: object): boolean;
|
||||
isClassMethod(opts?: object): boolean;
|
||||
isObjectPattern(opts?: object): boolean;
|
||||
isSpreadElement(opts?: object): boolean;
|
||||
isSuper(opts?: object): boolean;
|
||||
isTaggedTemplateExpression(opts?: object): boolean;
|
||||
isTemplateElement(opts?: object): boolean;
|
||||
isTemplateLiteral(opts?: object): boolean;
|
||||
isYieldExpression(opts?: object): boolean;
|
||||
isAnyTypeAnnotation(opts?: object): boolean;
|
||||
isArrayTypeAnnotation(opts?: object): boolean;
|
||||
isBooleanTypeAnnotation(opts?: object): boolean;
|
||||
isBooleanLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isNullLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isClassImplements(opts?: object): boolean;
|
||||
isClassProperty(opts?: object): boolean;
|
||||
isDeclareClass(opts?: object): boolean;
|
||||
isDeclareFunction(opts?: object): boolean;
|
||||
isDeclareInterface(opts?: object): boolean;
|
||||
isDeclareModule(opts?: object): boolean;
|
||||
isDeclareTypeAlias(opts?: object): boolean;
|
||||
isDeclareVariable(opts?: object): boolean;
|
||||
isExistentialTypeParam(opts?: object): boolean;
|
||||
isFunctionTypeAnnotation(opts?: object): boolean;
|
||||
isFunctionTypeParam(opts?: object): boolean;
|
||||
isGenericTypeAnnotation(opts?: object): boolean;
|
||||
isInterfaceExtends(opts?: object): boolean;
|
||||
isInterfaceDeclaration(opts?: object): boolean;
|
||||
isIntersectionTypeAnnotation(opts?: object): boolean;
|
||||
isMixedTypeAnnotation(opts?: object): boolean;
|
||||
isNullableTypeAnnotation(opts?: object): boolean;
|
||||
isNumericLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isNumberTypeAnnotation(opts?: object): boolean;
|
||||
isStringLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isStringTypeAnnotation(opts?: object): boolean;
|
||||
isThisTypeAnnotation(opts?: object): boolean;
|
||||
isTupleTypeAnnotation(opts?: object): boolean;
|
||||
isTypeofTypeAnnotation(opts?: object): boolean;
|
||||
isTypeAlias(opts?: object): boolean;
|
||||
isTypeAnnotation(opts?: object): boolean;
|
||||
isTypeCastExpression(opts?: object): boolean;
|
||||
isTypeParameterDeclaration(opts?: object): boolean;
|
||||
isTypeParameterInstantiation(opts?: object): boolean;
|
||||
isObjectTypeAnnotation(opts?: object): boolean;
|
||||
isObjectTypeCallProperty(opts?: object): boolean;
|
||||
isObjectTypeIndexer(opts?: object): boolean;
|
||||
isObjectTypeProperty(opts?: object): boolean;
|
||||
isQualifiedTypeIdentifier(opts?: object): boolean;
|
||||
isUnionTypeAnnotation(opts?: object): boolean;
|
||||
isVoidTypeAnnotation(opts?: object): boolean;
|
||||
isJSXAttribute(opts?: object): boolean;
|
||||
isJSXClosingElement(opts?: object): boolean;
|
||||
isJSXElement(opts?: object): boolean;
|
||||
isJSXEmptyExpression(opts?: object): boolean;
|
||||
isJSXExpressionContainer(opts?: object): boolean;
|
||||
isJSXIdentifier(opts?: object): boolean;
|
||||
isJSXMemberExpression(opts?: object): boolean;
|
||||
isJSXNamespacedName(opts?: object): boolean;
|
||||
isJSXOpeningElement(opts?: object): boolean;
|
||||
isJSXSpreadAttribute(opts?: object): boolean;
|
||||
isJSXText(opts?: object): boolean;
|
||||
isNoop(opts?: object): boolean;
|
||||
isParenthesizedExpression(opts?: object): boolean;
|
||||
isAwaitExpression(opts?: object): boolean;
|
||||
isBindExpression(opts?: object): boolean;
|
||||
isDecorator(opts?: object): boolean;
|
||||
isDoExpression(opts?: object): boolean;
|
||||
isExportDefaultSpecifier(opts?: object): boolean;
|
||||
isExportNamespaceSpecifier(opts?: object): boolean;
|
||||
isRestProperty(opts?: object): boolean;
|
||||
isSpreadProperty(opts?: object): boolean;
|
||||
isExpression(opts?: object): boolean;
|
||||
isBinary(opts?: object): boolean;
|
||||
isScopable(opts?: object): boolean;
|
||||
isBlockParent(opts?: object): boolean;
|
||||
isBlock(opts?: object): boolean;
|
||||
isStatement(opts?: object): boolean;
|
||||
isTerminatorless(opts?: object): boolean;
|
||||
isCompletionStatement(opts?: object): boolean;
|
||||
isConditional(opts?: object): boolean;
|
||||
isLoop(opts?: object): boolean;
|
||||
isWhile(opts?: object): boolean;
|
||||
isExpressionWrapper(opts?: object): boolean;
|
||||
isFor(opts?: object): boolean;
|
||||
isForXStatement(opts?: object): boolean;
|
||||
isFunction(opts?: object): boolean;
|
||||
isFunctionParent(opts?: object): boolean;
|
||||
isPureish(opts?: object): boolean;
|
||||
isDeclaration(opts?: object): boolean;
|
||||
isLVal(opts?: object): boolean;
|
||||
isLiteral(opts?: object): boolean;
|
||||
isImmutable(opts?: object): boolean;
|
||||
isUserWhitespacable(opts?: object): boolean;
|
||||
isMethod(opts?: object): boolean;
|
||||
isObjectMember(opts?: object): boolean;
|
||||
isProperty(opts?: object): boolean;
|
||||
isUnaryLike(opts?: object): boolean;
|
||||
isPattern(opts?: object): boolean;
|
||||
isClass(opts?: object): boolean;
|
||||
isModuleDeclaration(opts?: object): boolean;
|
||||
isExportDeclaration(opts?: object): boolean;
|
||||
isModuleSpecifier(opts?: object): boolean;
|
||||
isFlow(opts?: object): boolean;
|
||||
isFlowBaseAnnotation(opts?: object): boolean;
|
||||
isFlowDeclaration(opts?: object): boolean;
|
||||
isJSX(opts?: object): boolean;
|
||||
isNumberLiteral(opts?: object): boolean;
|
||||
isRegexLiteral(opts?: object): boolean;
|
||||
isReferencedIdentifier(opts?: object): boolean;
|
||||
isReferencedMemberExpression(opts?: object): boolean;
|
||||
isBindingIdentifier(opts?: object): boolean;
|
||||
isScope(opts?: object): boolean;
|
||||
isArrayExpression(opts?: object): this is NodePath<t.ArrayExpression> ;
|
||||
isAssignmentExpression(opts?: object): this is NodePath<t.AssignmentExpression>;
|
||||
isBinaryExpression(opts?: object): this is NodePath<t.BinaryExpression>;
|
||||
isDirective(opts?: object): this is NodePath<t.Directive>;
|
||||
isDirectiveLiteral(opts?: object): this is NodePath<t.DirectiveLiteral>;
|
||||
isBlockStatement(opts?: object): this is NodePath<t.BlockStatement>;
|
||||
isBreakStatement(opts?: object): this is NodePath<t.BreakStatement>;
|
||||
isCallExpression(opts?: object): this is NodePath<t.CallExpression>;
|
||||
isCatchClause(opts?: object): this is NodePath<t.CatchClause>;
|
||||
isConditionalExpression(opts?: object): this is NodePath<t.ConditionalExpression>;
|
||||
isContinueStatement(opts?: object): this is NodePath<t.ContinueStatement>;
|
||||
isDebuggerStatement(opts?: object): this is NodePath<t.DebuggerStatement>;
|
||||
isDoWhileStatement(opts?: object): this is NodePath<t.DoWhileStatement>;
|
||||
isEmptyStatement(opts?: object): this is NodePath<t.EmptyStatement>;
|
||||
isExpressionStatement(opts?: object): this is NodePath<t.ExpressionStatement>;
|
||||
isFile(opts?: object): this is NodePath<t.File>;
|
||||
isForInStatement(opts?: object): this is NodePath<t.ForInStatement>;
|
||||
isForStatement(opts?: object): this is NodePath<t.ForStatement>;
|
||||
isFunctionDeclaration(opts?: object): this is NodePath<t.FunctionDeclaration>;
|
||||
isFunctionExpression(opts?: object): this is NodePath<t.FunctionExpression>;
|
||||
isIdentifier(opts?: object): this is NodePath<t.Identifier>;
|
||||
isIfStatement(opts?: object): this is NodePath<t.IfStatement>;
|
||||
isLabeledStatement(opts?: object): this is NodePath<t.LabeledStatement>;
|
||||
isStringLiteral(opts?: object): this is NodePath<t.StringLiteral>;
|
||||
isNumericLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
|
||||
isNullLiteral(opts?: object): this is NodePath<t.NullLiteral>;
|
||||
isBooleanLiteral(opts?: object): this is NodePath<t.BooleanLiteral>;
|
||||
isRegExpLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
|
||||
isLogicalExpression(opts?: object): this is NodePath<t.LogicalExpression>;
|
||||
isMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
|
||||
isNewExpression(opts?: object): this is NodePath<t.NewExpression>;
|
||||
isProgram(opts?: object): this is NodePath<t.Program>;
|
||||
isObjectExpression(opts?: object): this is NodePath<t.ObjectExpression>;
|
||||
isObjectMethod(opts?: object): this is NodePath<t.ObjectMethod>;
|
||||
isObjectProperty(opts?: object): this is NodePath<t.ObjectProperty>;
|
||||
isRestElement(opts?: object): this is NodePath<t.RestElement>;
|
||||
isReturnStatement(opts?: object): this is NodePath<t.ReturnStatement>;
|
||||
isSequenceExpression(opts?: object): this is NodePath<t.SequenceExpression>;
|
||||
isSwitchCase(opts?: object): this is NodePath<t.SwitchCase>;
|
||||
isSwitchStatement(opts?: object): this is NodePath<t.SwitchStatement>;
|
||||
isThisExpression(opts?: object): this is NodePath<t.ThisExpression>;
|
||||
isThrowStatement(opts?: object): this is NodePath<t.ThrowStatement>;
|
||||
isTryStatement(opts?: object): this is NodePath<t.TryStatement>;
|
||||
isUnaryExpression(opts?: object): this is NodePath<t.UnaryExpression>;
|
||||
isUpdateExpression(opts?: object): this is NodePath<t.UpdateExpression>;
|
||||
isVariableDeclaration(opts?: object): this is NodePath<t.VariableDeclaration>;
|
||||
isVariableDeclarator(opts?: object): this is NodePath<t.VariableDeclarator>;
|
||||
isWhileStatement(opts?: object): this is NodePath<t.WhileStatement>;
|
||||
isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
|
||||
isAssignmentPattern(opts?: object): this is NodePath<t.AssignmentPattern>;
|
||||
isArrayPattern(opts?: object): this is NodePath<t.ArrayPattern>;
|
||||
isArrowFunctionExpression(opts?: object): this is NodePath<t.ArrowFunctionExpression>;
|
||||
isClassBody(opts?: object): this is NodePath<t.ClassBody>;
|
||||
isClassDeclaration(opts?: object): this is NodePath<t.ClassDeclaration>;
|
||||
isClassExpression(opts?: object): this is NodePath<t.ClassExpression>;
|
||||
isExportAllDeclaration(opts?: object): this is NodePath<t.ExportAllDeclaration>;
|
||||
isExportDefaultDeclaration(opts?: object): this is NodePath<t.ExportDefaultDeclaration>;
|
||||
isExportNamedDeclaration(opts?: object): this is NodePath<t.ExportNamedDeclaration>;
|
||||
isExportSpecifier(opts?: object): this is NodePath<t.ExportSpecifier>;
|
||||
isForOfStatement(opts?: object): this is NodePath<t.ForOfStatement>;
|
||||
isImportDeclaration(opts?: object): this is NodePath<t.ImportDeclaration>;
|
||||
isImportDefaultSpecifier(opts?: object): this is NodePath<t.ImportDefaultSpecifier>;
|
||||
isImportNamespaceSpecifier(opts?: object): this is NodePath<t.ImportNamespaceSpecifier>;
|
||||
isImportSpecifier(opts?: object): this is NodePath<t.ImportSpecifier>;
|
||||
isMetaProperty(opts?: object): this is NodePath<t.MetaProperty>;
|
||||
isClassMethod(opts?: object): this is NodePath<t.ClassMethod>;
|
||||
isObjectPattern(opts?: object): this is NodePath<t.ObjectPattern>;
|
||||
isSpreadElement(opts?: object): this is NodePath<t.SpreadElement>;
|
||||
isSuper(opts?: object): this is NodePath<t.Super>;
|
||||
isTaggedTemplateExpression(opts?: object): this is NodePath<t.TaggedTemplateExpression>;
|
||||
isTemplateElement(opts?: object): this is NodePath<t.TemplateElement>;
|
||||
isTemplateLiteral(opts?: object): this is NodePath<t.TemplateLiteral>;
|
||||
isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
|
||||
isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
|
||||
isArrayTypeAnnotation(opts?: object): this is NodePath<t.ArrayTypeAnnotation>;
|
||||
isBooleanTypeAnnotation(opts?: object): this is NodePath<t.BooleanTypeAnnotation>;
|
||||
isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<t.BooleanLiteralTypeAnnotation>;
|
||||
isNullLiteralTypeAnnotation(opts?: object): this is NodePath<t.NullLiteralTypeAnnotation>;
|
||||
isClassImplements(opts?: object): this is NodePath<t.ClassImplements>;
|
||||
isClassProperty(opts?: object): this is NodePath<t.ClassProperty>;
|
||||
isDeclareClass(opts?: object): this is NodePath<t.DeclareClass>;
|
||||
isDeclareFunction(opts?: object): this is NodePath<t.DeclareFunction>;
|
||||
isDeclareInterface(opts?: object): this is NodePath<t.DeclareInterface>;
|
||||
isDeclareModule(opts?: object): this is NodePath<t.DeclareModule>;
|
||||
isDeclareTypeAlias(opts?: object): this is NodePath<t.DeclareTypeAlias>;
|
||||
isDeclareVariable(opts?: object): this is NodePath<t.DeclareVariable>;
|
||||
isExistentialTypeParam(opts?: object): this is NodePath<t.ExistentialTypeParam>;
|
||||
isFunctionTypeAnnotation(opts?: object): this is NodePath<t.FunctionTypeAnnotation>;
|
||||
isFunctionTypeParam(opts?: object): this is NodePath<t.FunctionTypeParam>;
|
||||
isGenericTypeAnnotation(opts?: object): this is NodePath<t.GenericTypeAnnotation>;
|
||||
isInterfaceExtends(opts?: object): this is NodePath<t.InterfaceExtends>;
|
||||
isInterfaceDeclaration(opts?: object): this is NodePath<t.InterfaceDeclaration>;
|
||||
isIntersectionTypeAnnotation(opts?: object): this is NodePath<t.IntersectionTypeAnnotation>;
|
||||
isMixedTypeAnnotation(opts?: object): this is NodePath<t.MixedTypeAnnotation>;
|
||||
isNullableTypeAnnotation(opts?: object): this is NodePath<t.NullableTypeAnnotation>;
|
||||
isNumericLiteralTypeAnnotation(opts?: object): this is NodePath<t.NumericLiteralTypeAnnotation>;
|
||||
isNumberTypeAnnotation(opts?: object): this is NodePath<t.NumberTypeAnnotation>;
|
||||
isStringLiteralTypeAnnotation(opts?: object): this is NodePath<t.StringLiteralTypeAnnotation>;
|
||||
isStringTypeAnnotation(opts?: object): this is NodePath<t.StringTypeAnnotation>;
|
||||
isThisTypeAnnotation(opts?: object): this is NodePath<t.ThisTypeAnnotation>;
|
||||
isTupleTypeAnnotation(opts?: object): this is NodePath<t.TupleTypeAnnotation>;
|
||||
isTypeofTypeAnnotation(opts?: object): this is NodePath<t.TypeofTypeAnnotation>;
|
||||
isTypeAlias(opts?: object): this is NodePath<t.TypeAlias>;
|
||||
isTypeAnnotation(opts?: object): this is NodePath<t.TypeAnnotation>;
|
||||
isTypeCastExpression(opts?: object): this is NodePath<t.TypeCastExpression>;
|
||||
isTypeParameterDeclaration(opts?: object): this is NodePath<t.TypeParameterDeclaration>;
|
||||
isTypeParameterInstantiation(opts?: object): this is NodePath<t.TypeParameterInstantiation>;
|
||||
isObjectTypeAnnotation(opts?: object): this is NodePath<t.ObjectTypeAnnotation>;
|
||||
isObjectTypeCallProperty(opts?: object): this is NodePath<t.ObjectTypeCallProperty>;
|
||||
isObjectTypeIndexer(opts?: object): this is NodePath<t.ObjectTypeIndexer>;
|
||||
isObjectTypeProperty(opts?: object): this is NodePath<t.ObjectTypeProperty>;
|
||||
isQualifiedTypeIdentifier(opts?: object): this is NodePath<t.QualifiedTypeIdentifier>;
|
||||
isUnionTypeAnnotation(opts?: object): this is NodePath<t.UnionTypeAnnotation>;
|
||||
isVoidTypeAnnotation(opts?: object): this is NodePath<t.VoidTypeAnnotation>;
|
||||
isJSXAttribute(opts?: object): this is NodePath<t.JSXAttribute>;
|
||||
isJSXClosingElement(opts?: object): this is NodePath<t.JSXClosingElement>;
|
||||
isJSXElement(opts?: object): this is NodePath<t.JSXElement>;
|
||||
isJSXEmptyExpression(opts?: object): this is NodePath<t.JSXEmptyExpression>;
|
||||
isJSXExpressionContainer(opts?: object): this is NodePath<t.JSXExpressionContainer>;
|
||||
isJSXIdentifier(opts?: object): this is NodePath<t.JSXIdentifier>;
|
||||
isJSXMemberExpression(opts?: object): this is NodePath<t.JSXMemberExpression>;
|
||||
isJSXNamespacedName(opts?: object): this is NodePath<t.JSXNamespacedName>;
|
||||
isJSXOpeningElement(opts?: object): this is NodePath<t.JSXOpeningElement>;
|
||||
isJSXSpreadAttribute(opts?: object): this is NodePath<t.JSXSpreadAttribute>;
|
||||
isJSXText(opts?: object): this is NodePath<t.JSXText>;
|
||||
isNoop(opts?: object): this is NodePath<t.Noop>;
|
||||
isParenthesizedExpression(opts?: object): this is NodePath<t.ParenthesizedExpression>;
|
||||
isAwaitExpression(opts?: object): this is NodePath<t.AwaitExpression>;
|
||||
isBindExpression(opts?: object): this is NodePath<t.BindExpression>;
|
||||
isDecorator(opts?: object): this is NodePath<t.Decorator>;
|
||||
isDoExpression(opts?: object): this is NodePath<t.DoExpression>;
|
||||
isExportDefaultSpecifier(opts?: object): this is NodePath<t.ExportDefaultSpecifier>;
|
||||
isExportNamespaceSpecifier(opts?: object): this is NodePath<t.ExportNamespaceSpecifier>;
|
||||
isRestProperty(opts?: object): this is NodePath<t.RestProperty>;
|
||||
isSpreadProperty(opts?: object): this is NodePath<t.SpreadProperty>;
|
||||
isExpression(opts?: object): this is NodePath<t.Expression>;
|
||||
isBinary(opts?: object): this is NodePath<t.Binary>;
|
||||
isScopable(opts?: object): this is NodePath<t.Scopable>;
|
||||
isBlockParent(opts?: object): this is NodePath<t.BlockParent>;
|
||||
isBlock(opts?: object): this is NodePath<t.Block>;
|
||||
isStatement(opts?: object): this is NodePath<t.Statement>;
|
||||
isTerminatorless(opts?: object): this is NodePath<t.Terminatorless>;
|
||||
isCompletionStatement(opts?: object): this is NodePath<t.CompletionStatement>;
|
||||
isConditional(opts?: object): this is NodePath<t.Conditional>;
|
||||
isLoop(opts?: object): this is NodePath<t.Loop>;
|
||||
isWhile(opts?: object): this is NodePath<t.While>;
|
||||
isExpressionWrapper(opts?: object): this is NodePath<t.ExpressionWrapper>;
|
||||
isFor(opts?: object): this is NodePath<t.For>;
|
||||
isForXStatement(opts?: object): this is NodePath<t.ForXStatement>;
|
||||
isFunction(opts?: object): this is NodePath<t.Function>;
|
||||
isFunctionParent(opts?: object): this is NodePath<t.FunctionParent>;
|
||||
isPureish(opts?: object): this is NodePath<t.Pureish>;
|
||||
isDeclaration(opts?: object): this is NodePath<t.Declaration>;
|
||||
isLVal(opts?: object): this is NodePath<t.LVal>;
|
||||
isLiteral(opts?: object): this is NodePath<t.Literal>;
|
||||
isImmutable(opts?: object): this is NodePath<t.Immutable>;
|
||||
isUserWhitespacable(opts?: object): this is NodePath<t.UserWhitespacable>;
|
||||
isMethod(opts?: object): this is NodePath<t.Method>;
|
||||
isObjectMember(opts?: object): this is NodePath<t.ObjectMember>;
|
||||
isProperty(opts?: object): this is NodePath<t.Property>;
|
||||
isUnaryLike(opts?: object): this is NodePath<t.UnaryLike>;
|
||||
isPattern(opts?: object): this is NodePath<t.Pattern>;
|
||||
isClass(opts?: object): this is NodePath<t.Class>;
|
||||
isModuleDeclaration(opts?: object): this is NodePath<t.ModuleDeclaration>;
|
||||
isExportDeclaration(opts?: object): this is NodePath<t.ExportDeclaration>;
|
||||
isModuleSpecifier(opts?: object): this is NodePath<t.ModuleSpecifier>;
|
||||
isFlow(opts?: object): this is NodePath<t.Flow>;
|
||||
isFlowBaseAnnotation(opts?: object): this is NodePath<t.FlowBaseAnnotation>;
|
||||
isFlowDeclaration(opts?: object): this is NodePath<t.FlowDeclaration>;
|
||||
isJSX(opts?: object): this is NodePath<t.JSX>;
|
||||
isNumberLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
|
||||
isRegexLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
|
||||
isReferencedIdentifier(opts?: object): this is NodePath<t.Identifier | t.JSXIdentifier>;
|
||||
isReferencedMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
|
||||
isBindingIdentifier(opts?: object): this is NodePath<t.Identifier>;
|
||||
isScope(opts?: object): this is NodePath<t.Scopable>;
|
||||
isReferenced(opts?: object): boolean;
|
||||
isBlockScoped(opts?: object): boolean;
|
||||
isVar(opts?: object): boolean;
|
||||
isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
|
||||
isVar(opts?: object): this is NodePath<t.VariableDeclaration>;
|
||||
isUser(opts?: object): boolean;
|
||||
isGenerated(opts?: object): boolean;
|
||||
isPure(opts?: object): boolean;
|
||||
|
||||
Vendored
+6
-6
@@ -1265,13 +1265,13 @@ export function isJSX(node: object, opts?: object): node is JSX;
|
||||
export function isNumberLiteral(node: object, opts?: object): node is NumericLiteral;
|
||||
export function isRegexLiteral(node: object, opts?: object): node is RegExpLiteral;
|
||||
|
||||
export function isReferencedIdentifier(node: object, opts?: object): boolean;
|
||||
export function isReferencedMemberExpression(node: object, opts?: object): boolean;
|
||||
export function isBindingIdentifier(node: object, opts?: object): boolean;
|
||||
export function isScope(node: object, opts?: object): boolean;
|
||||
export function isReferencedIdentifier(node: object, opts?: object): node is Identifier | JSXIdentifier;
|
||||
export function isReferencedMemberExpression(node: object, opts?: object): node is MemberExpression;
|
||||
export function isBindingIdentifier(node: object, opts?: object): node is Identifier;
|
||||
export function isScope(node: object, opts?: object): node is Scopable;
|
||||
export function isReferenced(node: object, opts?: object): boolean;
|
||||
export function isBlockScoped(node: object, opts?: object): boolean;
|
||||
export function isVar(node: object, opts?: object): boolean;
|
||||
export function isBlockScoped(node: object, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration;
|
||||
export function isVar(node: object, opts?: object): node is VariableDeclaration;
|
||||
export function isUser(node: object, opts?: object): boolean;
|
||||
export function isGenerated(node: object, opts?: object): boolean;
|
||||
export function isPure(node: object, opts?: object): boolean;
|
||||
|
||||
Vendored
+1
-2
@@ -460,8 +460,7 @@ declare namespace Backbone {
|
||||
}
|
||||
|
||||
// SYNC
|
||||
function sync(method: string, model: Model, options?: JQueryAjaxSettings): any;
|
||||
function sync(method: string, collection: Collection<Model>, options?: JQueryAjaxSettings): any;
|
||||
function sync(method: string, model: Model | Collection<Model>, options?: JQueryAjaxSettings): any;
|
||||
function ajax(options?: JQueryAjaxSettings): JQueryXHR;
|
||||
var emulateHTTP: boolean;
|
||||
var emulateJSON: boolean;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import beats = require('beats');
|
||||
|
||||
const bins: beats.Bin[] = [
|
||||
{ lo: 0, hi: 512, threshold: 0, decay: 0.005 },
|
||||
{ lo: 512, hi: 1024, threshold: 0, decay: 0.005 },
|
||||
];
|
||||
|
||||
const detect = beats(bins, 1);
|
||||
|
||||
const frequencies = new Uint8Array(1024);
|
||||
const result = detect(frequencies);
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for beats 0.0
|
||||
// Project: https://github.com/hughsk/beats/
|
||||
// Definitions by: Uri Shaked <https://github.com/urish>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = beats;
|
||||
|
||||
declare function beats(bins: ReadonlyArray<beats.Bin>, minSeparation?: number): (frequencies: Uint8Array | Float32Array | ReadonlyArray<number>, dt?: number) => Float32Array;
|
||||
|
||||
declare namespace beats {
|
||||
interface Bin {
|
||||
lo: number;
|
||||
hi: number;
|
||||
threshold: number;
|
||||
decay: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"beats-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1357,6 +1357,56 @@ suite('assert', () => {
|
||||
assert.notInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('deepInclude', () => {
|
||||
assert.deepInclude('foobar', 'bar');
|
||||
assert.deepInclude([1, 2, 3], 3);
|
||||
assert.deepInclude('foobar', 'baz');
|
||||
assert.deepInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('notDeepInclude', () => {
|
||||
assert.notDeepInclude('foobar', 'baz');
|
||||
assert.notDeepInclude([1, 2, 3], 4);
|
||||
assert.notDeepInclude('foobar', 'bar');
|
||||
assert.notDeepInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('nestedInclude', () => {
|
||||
assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
|
||||
assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
|
||||
});
|
||||
|
||||
test('notNestedInclude', () => {
|
||||
assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
|
||||
assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
|
||||
});
|
||||
|
||||
test('deepNestedInclude', () => {
|
||||
assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}});
|
||||
assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
|
||||
});
|
||||
|
||||
test('notDeepNestedInclude', () => {
|
||||
assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
|
||||
assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
|
||||
});
|
||||
|
||||
test('ownInclude', () => {
|
||||
assert.ownInclude({ a: 1 }, { a: 1 });
|
||||
});
|
||||
|
||||
test('notOwnInclude', () => {
|
||||
assert.notOwnInclude({ a: 1 }, { a: 1 });
|
||||
});
|
||||
|
||||
test('deepOwnInclude', () => {
|
||||
assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
|
||||
});
|
||||
|
||||
test('notDeepOwnInclude', () => {
|
||||
assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
|
||||
});
|
||||
|
||||
test('lengthOf', () => {
|
||||
assert.lengthOf([1, 2, 3], 3);
|
||||
assert.lengthOf('foobar', 6);
|
||||
|
||||
Vendored
+134
-1
@@ -7,6 +7,7 @@
|
||||
// Matt Wistrand <https://github.com/mwistrand>,
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Shaun Luttin <https://github.com/shaunluttin>
|
||||
// Gintautas Miselis <https://github.com/Naktibalda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// <reference types="assertion-error"/>
|
||||
@@ -706,13 +707,145 @@ declare namespace Chai {
|
||||
/**
|
||||
* Asserts that haystack does not include needle.
|
||||
*
|
||||
* @type T Type of values in haystack.
|
||||
* @param haystack Container array.
|
||||
* @param needle Potential value contained in haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notInclude(haystack: any[], needle: any, message?: string): void;
|
||||
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack Container string.
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepInclude(haystack: string, needle: string, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepInclude<T>(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack Container string.
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepInclude(haystack: string, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepInclude(haystack: any[], needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
nestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while checking for deep equality
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object while checking for deep equality.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
ownInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties and checking for deep
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties and checking for deep equality.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that value matches the regular expression regexp.
|
||||
*
|
||||
|
||||
Vendored
+1
@@ -159,6 +159,7 @@ declare namespace Chart {
|
||||
interface ChartOptions {
|
||||
responsive?: boolean;
|
||||
responsiveAnimationDuration?: number;
|
||||
aspectRatio?: number;
|
||||
maintainAspectRatio?: boolean;
|
||||
events?: string[];
|
||||
onClick?(event?: MouseEvent, activeElements?: Array<{}>): any;
|
||||
|
||||
Vendored
+1
@@ -263,6 +263,7 @@ interface CheerioElement {
|
||||
parent: CheerioElement;
|
||||
parentNode: CheerioElement;
|
||||
nodeValue: string;
|
||||
data?: string;
|
||||
}
|
||||
|
||||
interface CheerioAPI extends CheerioSelector, CheerioStatic {
|
||||
|
||||
Vendored
+4
@@ -602,13 +602,17 @@ declare namespace CKEDITOR {
|
||||
browserContextMenuOnCtrl?: boolean;
|
||||
|
||||
clipboard_defaultContentType?: string; // html | text
|
||||
clipboard_notificationDuration?: number;
|
||||
codeSnippet_codeClass?: string;
|
||||
codeSnippet_languages?: Object;
|
||||
coceSnippet_theme?: string;
|
||||
colorButton_backStyle?: config.styleObject;
|
||||
colorButton_colors?: string;
|
||||
colorButton_colorsPerRow?: number;
|
||||
colorButton_enableAutomatic?: boolean;
|
||||
colorButton_enableMore?: boolean;
|
||||
colorButton_foreStyle?: config.styleObject;
|
||||
colorButton_normalizeBackground?: boolean;
|
||||
contentsCss?: string | string[];
|
||||
contentsLangDirection?: string;
|
||||
contentsLanguage?: string;
|
||||
|
||||
Vendored
+18
-11
@@ -105,9 +105,9 @@ declare namespace CodeMirror {
|
||||
function signal(target: any, name: string, ...args: any[]): void;
|
||||
|
||||
type DOMEvent = 'mousedown' | 'dblclick' | 'touchstart' | 'contextmenu' | 'keydown' | 'keypress' | 'keyup' | 'cut' | 'copy' | 'paste' | 'dragstart' | 'dragenter' | 'dragover' | 'dragleave' | 'drop';
|
||||
|
||||
|
||||
type CoordsMode = 'window' | 'page' | 'local';
|
||||
|
||||
|
||||
interface Token {
|
||||
/** The character(on the given line) at which the token starts. */
|
||||
start: number;
|
||||
@@ -202,10 +202,10 @@ declare namespace CodeMirror {
|
||||
/** Compute the line at the given pixel height. mode is the relative element
|
||||
to use to compute this line, it may be "window", "page" (the default), or "local" */
|
||||
lineAtHeight(height: number, mode?: CoordsMode): number;
|
||||
|
||||
/** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window",
|
||||
"page" (the default), or "local". When a line below the bottom of the document is specified, the returned value
|
||||
is the bottom of the last line in the document. By default, the position of the actual text is returned.
|
||||
|
||||
/** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window",
|
||||
"page" (the default), or "local". When a line below the bottom of the document is specified, the returned value
|
||||
is the bottom of the last line in the document. By default, the position of the actual text is returned.
|
||||
If includeWidgets is true and the line has line widgets, the position above the first line widget is returned. */
|
||||
heightAtLine(line: any, mode?: CoordsMode, includeWidgets?: boolean): number;
|
||||
|
||||
@@ -292,7 +292,7 @@ declare namespace CodeMirror {
|
||||
charCoords(pos: CodeMirror.Position, mode?: CoordsMode): { left: number; right: number; top: number; bottom: number; };
|
||||
|
||||
/** Given an { left , top } object , returns the { line , ch } position that corresponds to it.
|
||||
The optional mode parameter determines relative to what the coordinates are interpreted.
|
||||
The optional mode parameter determines relative to what the coordinates are interpreted.
|
||||
It may be "window", "page" (the default), or "local". */
|
||||
coordsChar(object: { left: number; top: number; }, mode?: CoordsMode): CodeMirror.Position;
|
||||
|
||||
@@ -512,7 +512,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Get the currently selected code. */
|
||||
getSelection(): string;
|
||||
|
||||
|
||||
/** Returns an array containing a string for each selection, representing the content of the selections. */
|
||||
getSelections(lineSep?: string): Array<string>;
|
||||
|
||||
@@ -535,8 +535,14 @@ declare namespace CodeMirror {
|
||||
/** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */
|
||||
setCursor(pos: CodeMirror.Position): void;
|
||||
|
||||
/** Set the selection range.anchor and head should be { line , ch } objects.head defaults to anchor when not given. */
|
||||
setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position): void;
|
||||
/** Set a single selection range. anchor and head should be {line, ch} objects. head defaults to anchor when not given. */
|
||||
setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
|
||||
/** Sets a new set of selections. There must be at least one selection in the given array. When primary is a
|
||||
number, it determines which selection is the primary one. When it is not given, the primary index is taken from
|
||||
the previous selection, or set to the last range if the previous selection had less ranges than the new one.
|
||||
Supports the same options as setSelection. */
|
||||
setSelections(ranges: Array<{ anchor: CodeMirror.Position, head: CodeMirror.Position }>, primary?: number, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
|
||||
/** Similar to setSelection , but will, if shift is held or the extending flag is set,
|
||||
move the head of the selection while leaving the anchor at its current place.
|
||||
@@ -779,7 +785,7 @@ declare namespace CodeMirror {
|
||||
/** Determines whether the gutter scrolls along with the content horizontally (false)
|
||||
or whether it stays fixed during horizontal scrolling (true, the default). */
|
||||
fixedGutter?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Chooses a scrollbar implementation. The default is "native", showing native scrollbars. The core library also
|
||||
* provides the "null" style, which completely hides the scrollbars. Addons can implement additional scrollbar models.
|
||||
@@ -1141,6 +1147,7 @@ declare namespace CodeMirror {
|
||||
interface LintStateOptions {
|
||||
async: boolean;
|
||||
hasGutters: boolean;
|
||||
onUpdateLinting?: (annotationsNotSorted: Annotation[], annotations: Annotation[], codeMirror: Editor) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+13
-8
@@ -2,9 +2,9 @@
|
||||
// Project: https://github.com/apache/cordova-plugin-device
|
||||
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft Open Technologies Inc
|
||||
// Licensed under the MIT license
|
||||
// Licensed under the MIT license
|
||||
|
||||
/**
|
||||
* This plugin defines a global device object, which describes the device's hardware and software.
|
||||
@@ -26,11 +26,16 @@ interface Device {
|
||||
uuid: string;
|
||||
/** Get the operating system version. */
|
||||
version: string;
|
||||
/** Get the device's manufacturer. */
|
||||
manufacturer: string;
|
||||
/** Whether the device is running on a simulator. */
|
||||
isVirtual: boolean;
|
||||
/** Get the device hardware serial number. */
|
||||
serial: string;}
|
||||
/** Get the device's manufacturer. */
|
||||
manufacturer: string;
|
||||
/** Whether the device is running on a simulator. */
|
||||
isVirtual: boolean;
|
||||
/** Get the device hardware serial number. */
|
||||
serial: string;
|
||||
}
|
||||
|
||||
interface Window {
|
||||
device: Device;
|
||||
}
|
||||
|
||||
declare var device: Device;
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
Keyboard.shrinkView(true);
|
||||
Keyboard.shrinkView(false);
|
||||
Keyboard.shrinkView(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.hideFormAccessoryBar(true);
|
||||
Keyboard.hideFormAccessoryBar(false);
|
||||
Keyboard.hideFormAccessoryBar(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.disableScrollingInShrinkView(true);
|
||||
Keyboard.disableScrollingInShrinkView(false);
|
||||
Keyboard.disableScrollingInShrinkView(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.hide();
|
||||
|
||||
Keyboard.show();
|
||||
|
||||
if (Keyboard.isVisible) {
|
||||
console.log('Keyboard is visible');
|
||||
}
|
||||
Keyboard.automaticScrollToTopOnHiding = true;
|
||||
Keyboard.onshow = function () {
|
||||
console.log('onshow');
|
||||
};
|
||||
Keyboard.onhide = function () {
|
||||
console.log('onhide');
|
||||
};
|
||||
Keyboard.onshowing = function () {
|
||||
console.log('onshowing');
|
||||
};
|
||||
Keyboard.onhiding= function () {
|
||||
console.log('onhiding');
|
||||
};
|
||||
|
||||
Keyboard.automaticScrollToTopOnHiding = true;
|
||||
|
||||
window.addEventListener('keyboardDidShow', () => console.log('keyboardDidShow'));
|
||||
|
||||
window.addEventListener('keyboardDidHide', () => console.log('keyboardDidHide'));
|
||||
|
||||
window.addEventListener('keyboardWillShow', () => console.log('keyboardWillShow'));
|
||||
|
||||
window.addEventListener('keyboardWillHide', () => console.log('keyboardWillHide'));
|
||||
|
||||
window.addEventListener('keyboardHeightWillChange', (event: CordovaKeyboardEvent) => console.log(`keyboardHeightWillChange - keyboard height: ${event.keyboardHeight}`));
|
||||
|
||||
+99
-88
@@ -1,32 +1,9 @@
|
||||
// Type definitions for Apache Cordova Keyboard plugin v0.1.2
|
||||
// Project: https://github.com/apache/cordova-plugins/tree/master/keyboard
|
||||
// Definitions by: Dan Manastireanu <https://github.com/danmana>
|
||||
// Type definitions for Apache Cordova Keyboard plugin v1.2.0
|
||||
// Project: https://github.com/cjpearson/cordova-plugin-keyboard
|
||||
// Definitions by: Dan Manastireanu <https://github.com/danmana>
|
||||
// Jochen Becker <https://github.com/jkfb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The Keyboard object provides some functions to customize the iOS keyboard.
|
||||
*
|
||||
* <i>Supported Platforms: iOS</i>
|
||||
*
|
||||
* This plugin has only been tested in Cordova 3.2 or greater,
|
||||
* and its use in previous Cordova versions is not recommended
|
||||
* (potential conflict with keyboard customization code present in the core in previous Cordova versions).
|
||||
*
|
||||
* If you do use this plugin in an older Cordova version (again, not recommended),
|
||||
* you have to make sure the HideKeyboardFormAccessoryBar and KeyboardShrinksView preference values are always false,
|
||||
* and only use the API functions to turn things on/off.
|
||||
*
|
||||
* This plugin supports the HideKeyboardFormAccessoryBar (boolean)
|
||||
* and KeyboardShrinksView (boolean) preferences in config.xml.
|
||||
*
|
||||
* Permissions in config.xml
|
||||
* <code>
|
||||
* <feature name="Keyboard">
|
||||
* <param name="ios-package" value="CDVKeyboard" onload="true" />
|
||||
* </feature>
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
interface Keyboard {
|
||||
|
||||
// Methods
|
||||
@@ -39,15 +16,20 @@ interface Keyboard {
|
||||
* This applies to apps that position their elements relative to the bottom of the WebView.
|
||||
* This is the default behaviour on Android, and makes a lot of sense when building apps as opposed to webpages.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.shrinkView(true);
|
||||
* Keyboard.shrinkView(false);
|
||||
* Keyboard.shrinkView(null, function (currentValue) { console.log(currentValue); });
|
||||
* </code>
|
||||
*
|
||||
* @param shrink
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
shrinkView(shrink:boolean): void,
|
||||
shrinkView(shrink: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Hide the keyboard toolbar.
|
||||
@@ -55,21 +37,29 @@ interface Keyboard {
|
||||
* Set to true to hide the additional toolbar that is on top of the keyboard.
|
||||
* This toolbar features the Prev, Next, and Done buttons.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.hideFormAccessoryBar(true);
|
||||
* Keyboard.hideFormAccessoryBar(false);
|
||||
* Keyboard.hideFormAccessoryBar(null, function (currentValue) { console.log(currentValue); });
|
||||
* </code>
|
||||
*
|
||||
* @param hide
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
hideFormAccessoryBar(hide:boolean): void,
|
||||
hideFormAccessoryBar(hide: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Disable scrolling when the the WebView is shrunk.
|
||||
*
|
||||
* Set to true to disable scrolling when the WebView is shrunk.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.disableScrollingInShrinkView(true);
|
||||
@@ -77,8 +67,40 @@ interface Keyboard {
|
||||
* </code>
|
||||
*
|
||||
* @param disable
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
disableScrollingInShrinkView(disable:boolean): void,
|
||||
disableScrollingInShrinkView(disable: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Hide the keyboard
|
||||
*
|
||||
* Call this method to hide the keyboard
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
* - Android
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.hide();
|
||||
* </code>
|
||||
*/
|
||||
hide(): void,
|
||||
|
||||
/**
|
||||
* Show the keyboard
|
||||
*
|
||||
* Call this method to show the keyboard.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - Android
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.show();
|
||||
* </code>
|
||||
*/
|
||||
show(): void,
|
||||
|
||||
// Properties
|
||||
|
||||
@@ -87,6 +109,9 @@ interface Keyboard {
|
||||
*
|
||||
* Read this property to determine if the keyboard is visible.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* if (Keyboard.isVisible) {
|
||||
@@ -102,6 +127,9 @@ interface Keyboard {
|
||||
* Set this to true if you need that page scroll to beginning when keyboard is hiding.
|
||||
* This is allows to fix issue with elements declared with position: fixed, after keyboard is hiding.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.automaticScrollToTopOnHiding = true;
|
||||
@@ -110,65 +138,48 @@ interface Keyboard {
|
||||
*/
|
||||
automaticScrollToTopOnHiding: boolean,
|
||||
|
||||
// Events
|
||||
/**
|
||||
* Deprecated Events
|
||||
*/
|
||||
onshow(): void,
|
||||
|
||||
/**
|
||||
* If defined, this function is fired when keyboard fully shown.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is shown.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onshow = function () {
|
||||
* // Describe your logic which will be run each time keyboard is shown.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onshow():void,
|
||||
/**
|
||||
* If defined, this function is fired when keyboard fully closed.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is closed.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onhide = function () {
|
||||
* // Describe your logic which will be run each time keyboard is closed.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onhide():void,
|
||||
/**
|
||||
* If defined, this function is fired before keyboard will be shown.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is about to be shown on the screen.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onshowing = function () {
|
||||
* // Describe your logic which will be run each time when keyboard is about to be shown.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onshowing():void,
|
||||
/**
|
||||
* If defined, this function is fired when keyboard is about to be closed.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is about to be closed.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onhiding = function () {
|
||||
* // Describe your logic which will be run each time when keyboard is about to be closed.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onhiding():void,
|
||||
onhide(): void,
|
||||
|
||||
onhiding(): void,
|
||||
|
||||
onshowing(): void
|
||||
}
|
||||
|
||||
declare var Keyboard:Keyboard;
|
||||
interface CordovaKeyboardEvent extends Event {
|
||||
/** The height of the keyboard */
|
||||
keyboardHeight: number;
|
||||
}
|
||||
|
||||
interface WindowEventMap {
|
||||
/**
|
||||
* This event is fired when keyboard fully shown.
|
||||
*/
|
||||
'keyboardDidShow': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardDidHide': Event,
|
||||
|
||||
/**
|
||||
* This event fires before keyboard will be shown.
|
||||
*/
|
||||
'keyboardWillShow': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardWillHide': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardHeightWillChange': CordovaKeyboardEvent
|
||||
}
|
||||
|
||||
declare var Keyboard: Keyboard;
|
||||
|
||||
Vendored
+23
-18
@@ -112,7 +112,7 @@ export interface Comment extends Node {
|
||||
/**
|
||||
* The @charset at-rule.
|
||||
*/
|
||||
export interface Charset {
|
||||
export interface Charset extends Node {
|
||||
/** The part following @charset. */
|
||||
charset?: string;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ export interface Charset {
|
||||
/**
|
||||
* The @custom-media at-rule
|
||||
*/
|
||||
export interface CustomMedia {
|
||||
export interface CustomMedia extends Node {
|
||||
/** The ---prefixed name. */
|
||||
name?: string;
|
||||
/** The part following the name. */
|
||||
@@ -130,7 +130,7 @@ export interface CustomMedia {
|
||||
/**
|
||||
* The @document at-rule.
|
||||
*/
|
||||
export interface Document {
|
||||
export interface Document extends Node {
|
||||
/** The part following @document. */
|
||||
document?: string;
|
||||
/** The vendor prefix in @document, or undefined if there is none. */
|
||||
@@ -142,7 +142,7 @@ export interface Document {
|
||||
/**
|
||||
* The @font-face at-rule.
|
||||
*/
|
||||
export interface FontFace {
|
||||
export interface FontFace extends Node {
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export interface FontFace {
|
||||
/**
|
||||
* The @host at-rule.
|
||||
*/
|
||||
export interface Host {
|
||||
export interface Host extends Node {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ export interface Host {
|
||||
/**
|
||||
* The @import at-rule.
|
||||
*/
|
||||
export interface Import {
|
||||
export interface Import extends Node {
|
||||
/** The part following @import. */
|
||||
import?: string;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export interface Import {
|
||||
/**
|
||||
* The @keyframes at-rule.
|
||||
*/
|
||||
export interface KeyFrames {
|
||||
export interface KeyFrames extends Node {
|
||||
/** The name of the keyframes rule. */
|
||||
name?: string;
|
||||
/** The vendor prefix in @keyframes, or undefined if there is none. */
|
||||
@@ -175,7 +175,7 @@ export interface KeyFrames {
|
||||
keyframes?: Array<KeyFrame | Comment>;
|
||||
}
|
||||
|
||||
export interface KeyFrame {
|
||||
export interface KeyFrame extends Node {
|
||||
/** The list of "selectors" of the keyframe rule, split on commas. Each “selector” is trimmed from whitespace. */
|
||||
values?: Array<string>;
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
@@ -185,7 +185,7 @@ export interface KeyFrame {
|
||||
/**
|
||||
* The @media at-rule.
|
||||
*/
|
||||
export interface Media {
|
||||
export interface Media extends Node {
|
||||
/** The part following @media. */
|
||||
media?: string;
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
@@ -195,7 +195,7 @@ export interface Media {
|
||||
/**
|
||||
* The @namespace at-rule.
|
||||
*/
|
||||
export interface Namespace {
|
||||
export interface Namespace extends Node {
|
||||
/** The part following @namespace. */
|
||||
namespace?: string;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export interface Namespace {
|
||||
/**
|
||||
* The @page at-rule.
|
||||
*/
|
||||
export interface Page {
|
||||
export interface Page extends Node {
|
||||
/** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */
|
||||
selectors?: Array<string>;
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
@@ -213,7 +213,7 @@ export interface Page {
|
||||
/**
|
||||
* The @supports at-rule.
|
||||
*/
|
||||
export interface Supports {
|
||||
export interface Supports extends Node {
|
||||
/** The part following @supports. */
|
||||
supports?: string;
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
@@ -223,16 +223,21 @@ export interface Supports {
|
||||
/** All at-rules. */
|
||||
export type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
|
||||
|
||||
/**
|
||||
* A collection of rules
|
||||
*/
|
||||
export interface StyleRules {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules: Array<Rule | Comment | AtRule>;
|
||||
/** Array of Errors. Errors collected during parsing when option silent is true. */
|
||||
parsingErrors?: Array<ParserError>
|
||||
}
|
||||
|
||||
/**
|
||||
* The root node returned by css.parse.
|
||||
*/
|
||||
export interface Stylesheet extends Node {
|
||||
stylesheet?: {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
/** Array of Errors. Errors collected during parsing when option silent is true. */
|
||||
parsingErrors?: Array<ParserError>
|
||||
};
|
||||
stylesheet?: StyleRules;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
@@ -1036,6 +1036,19 @@ positions = d3Selection.touches(svg, changedTouches);
|
||||
positions = d3Selection.touches(g, changedTouches);
|
||||
positions = d3Selection.touches(h, changedTouches);
|
||||
|
||||
// clientPoint() ---------------------------------------------------------------------
|
||||
|
||||
let clientPoint: [number, number];
|
||||
declare let mEvt: MouseEvent;
|
||||
declare let tEvt: Touch;
|
||||
declare let msgEvt: MSGestureEvent;
|
||||
declare let customEvt: {clientX: number, clientY: number}; // minimally conforming object
|
||||
|
||||
clientPoint = d3Selection.clientPoint(svg, mEvt);
|
||||
clientPoint = d3Selection.clientPoint(g, tEvt);
|
||||
clientPoint = d3Selection.clientPoint(h, msgEvt);
|
||||
clientPoint = d3Selection.clientPoint(h, customEvt);
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Tests of style
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+31
-14
@@ -1,9 +1,9 @@
|
||||
// Type definitions for D3JS d3-selection module 1.1
|
||||
// Type definitions for D3JS d3-selection module 1.2
|
||||
// Project: https://github.com/d3/d3-selection/
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Last module patch version validated against: 1.1
|
||||
// Last module patch version validated against: 1.2.0
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Shared Type Definitions and Interfaces
|
||||
@@ -44,6 +44,14 @@ export interface EnterElement {
|
||||
*/
|
||||
export type ContainerElement = HTMLElement | SVGSVGElement | SVGGElement;
|
||||
|
||||
/**
|
||||
* A User interface event (e.g. mouse event, touch or MSGestureEvent) with captured clientX and clientY properties.
|
||||
*/
|
||||
export interface ClientPointEvent {
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for optional parameters map, when dispatching custom events
|
||||
* on a selection
|
||||
@@ -670,7 +678,8 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
|
||||
*
|
||||
* If a key function is not specified, then the first datum in data is assigned to the first selected element,
|
||||
* the second datum to the second selected element, and so on.
|
||||
* A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index.
|
||||
* A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index,
|
||||
* by computing a string identifier for each datum and element.
|
||||
*
|
||||
* The update and enter selections are returned in data order, while the exit selection preserves the selection
|
||||
* order prior to the join. If a key function is specified, the order of elements in the selection may not match
|
||||
@@ -684,9 +693,9 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
|
||||
*
|
||||
* @param data The specified data is an array of arbitrary values (e.g., numbers or objects).
|
||||
* @param key An optional key function which is evaluated for each selected element, in order, being passed the
|
||||
* current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]).
|
||||
* current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]); the returned string is the element’s key.
|
||||
* The key function is then also evaluated for each new datum in data, being passed the current datum (d),
|
||||
* the current index (i), and the group’s new data, with this as the group’s parent DOM element (nodes[i]).
|
||||
* the current index (i), and the group’s new data, with this as the group’s parent DOM element (nodes[i]); the returned string is the datum’s key.
|
||||
* The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key,
|
||||
* the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection.
|
||||
*/
|
||||
@@ -700,7 +709,8 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
|
||||
*
|
||||
* If a key function is not specified, then the first datum in data is assigned to the first selected element,
|
||||
* the second datum to the second selected element, and so on.
|
||||
* A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index.
|
||||
* A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index,
|
||||
* by computing a string identifier for each datum and element.
|
||||
*
|
||||
* The update and enter selections are returned in data order, while the exit selection preserves the selection
|
||||
* order prior to the join. If a key function is specified, the order of elements in the selection may not match
|
||||
@@ -716,9 +726,9 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
|
||||
* (d, which may be undefined), the group index (i), and the selection’s parent nodes (nodes),
|
||||
* with this as the group’s parent element. The function returns an array of values for each group.
|
||||
* @param key An optional key function which is evaluated for each selected element, in order, being passed the
|
||||
* current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]).
|
||||
* current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]); the returned string is the element’s key.
|
||||
* The key function is then also evaluated for each new datum in data, being passed the current datum (d),
|
||||
* the current index (i), and the group’s new data, with this as the group’s parent DOM element.
|
||||
* the current index (i), and the group’s new data, with this as the group’s parent DOM element (nodes[i]); the returned string is the datum’s key.
|
||||
* The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key,
|
||||
* the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection.
|
||||
*/
|
||||
@@ -726,16 +736,13 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
|
||||
|
||||
/**
|
||||
* Return the enter selection: placeholder nodes for each datum that had no corresponding DOM element
|
||||
* in the selection. The enter selection is determined by selection.data, and is empty on a selection that
|
||||
* is not joined to data.
|
||||
* in the selection. (The enter selection is empty for selections not returned by selection.data.)
|
||||
*/
|
||||
enter(): Selection<EnterElement, Datum, PElement, PDatum>;
|
||||
|
||||
/**
|
||||
* Return the exit selection: existing DOM elements in the selection for which no new datum was found.
|
||||
* The exit selection is determined by the previous selection.data, and is thus empty until the selection is
|
||||
* joined to data. If the exit selection is retrieved more than once after a data join, subsequent calls return
|
||||
* the empty selection.
|
||||
* Returns the exit selection: existing DOM elements in the selection for which no new datum was found.
|
||||
* (The exit selection is empty for selections not returned by selection.data.)
|
||||
*
|
||||
* IMPORTANT: The generic refers to the type of the old datum associated with the exit selection elements.
|
||||
* Ensure you set the generic to the correct type, if you need to access the data on the exit selection in
|
||||
@@ -972,6 +979,16 @@ export function touch(container: ContainerElement, touches: TouchList, identifie
|
||||
*/
|
||||
export function touches(container: ContainerElement, touches?: TouchList): Array<[number, number]>;
|
||||
|
||||
/**
|
||||
* Returns the x and y coordinates of the specified event relative to the specified container.
|
||||
* (The event may also be a touch.) The container may be an HTML or SVG container element, such as a G element or an SVG element.
|
||||
* The coordinates are returned as a two-element array of numbers [x, y].
|
||||
*
|
||||
* @param container Container element relative to which coordinates are calculated.
|
||||
* @param event A User interface event (e.g. mouse event, touch or MSGestureEvent) with captured clientX and clientY properties.
|
||||
*/
|
||||
export function clientPoint(container: ContainerElement, event: ClientPointEvent): [number, number];
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// style
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for D3JS d3 standard bundle 4.11
|
||||
// Type definitions for D3JS d3 standard bundle 4.12
|
||||
// Project: https://github.com/d3/d3
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -1,8 +1,39 @@
|
||||
const gDagre = new dagre.graphlib.Graph();
|
||||
const gDagre = new dagre.graphlib.Graph({compound: true, multigraph: false});
|
||||
gDagre.setGraph({})
|
||||
.setDefaultEdgeLabel(() => ({}))
|
||||
.setDefaultNodeLabel(() => ({}))
|
||||
.setNode("a", {})
|
||||
.setEdge("b", "c")
|
||||
.setEdge("c", "d", {class: "class"});
|
||||
|
||||
dagre.layout(gDagre);
|
||||
|
||||
gDagre.edge({v: 'b', w: 'c'});
|
||||
gDagre.hasEdge({v: 'b', w: 'c'});
|
||||
gDagre.inEdges('c');
|
||||
gDagre.outEdges('c');
|
||||
|
||||
gDagre.setParent('a', 'b');
|
||||
gDagre.children('b');
|
||||
gDagre.hasNode('d');
|
||||
gDagre.neighbors('c');
|
||||
gDagre.node({});
|
||||
gDagre.parent('a');
|
||||
gDagre.predecessors('d');
|
||||
gDagre.successors('b');
|
||||
|
||||
gDagre.removeEdge('c', 'd').removeNode('d');
|
||||
|
||||
dagre.graphlib.json.read(dagre.graphlib.json.write(gDagre));
|
||||
|
||||
dagre.graphlib.alg.components(gDagre);
|
||||
dagre.graphlib.alg.dijkstra(gDagre, 'a', (edge) => 5);
|
||||
dagre.graphlib.alg.dijkstraAll(gDagre);
|
||||
dagre.graphlib.alg.findCycles(gDagre);
|
||||
dagre.graphlib.alg.floydWarchall(gDagre);
|
||||
dagre.graphlib.alg.isAcyclic(gDagre);
|
||||
dagre.graphlib.alg.postorder(gDagre, 'a');
|
||||
dagre.graphlib.alg.preorder(gDagre, ['b', 'c']);
|
||||
dagre.graphlib.alg.prim(gDagre);
|
||||
dagre.graphlib.alg.tarjam(gDagre);
|
||||
dagre.graphlib.alg.topsort(gDagre);
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ export namespace graphlib {
|
||||
predecessors(name: string): Node[]|undefined;
|
||||
removeNode(name: string): Graph;
|
||||
setDefaultNodeLabel(callback: string|((nodeId: string) => string|Label)): Graph;
|
||||
setNode(id: string, node: NodeConfig): Graph;
|
||||
setNode(name: string, label: string|Label): Graph;
|
||||
setParent(childName: string, parentName: string): void;
|
||||
sinks(): Node[];
|
||||
sources(): Node[];
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { parse, CommandEntry, ParseOptions } from 'docker-file-parser';
|
||||
|
||||
const file = `
|
||||
FROM node:8
|
||||
|
||||
ADD . /opt/
|
||||
WORKDIR /opt
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
EXPOSE 8080
|
||||
VOLUME /opt/scripts
|
||||
|
||||
CMD ["npm", "start"]
|
||||
`;
|
||||
|
||||
const options: ParseOptions = {
|
||||
includeComments: false
|
||||
};
|
||||
|
||||
const result: CommandEntry[] = parse(file, options);
|
||||
const line1Name = result[0].name;
|
||||
const line1Number = result[0].lineno;
|
||||
const line1Args = result[0].args;
|
||||
const line1Raw = result[0].raw;
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for docker-file-parser 1.0
|
||||
// Project: https://github.com/joyent/docker-file-parse
|
||||
// Definitions by: Yash Kulshrestha <https://github.com/yashdalfthegray>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface CommandEntry {
|
||||
name: string;
|
||||
args: string[];
|
||||
lineno: number;
|
||||
raw: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface ParseOptions {
|
||||
includeComments: boolean;
|
||||
}
|
||||
|
||||
export function parse(
|
||||
contents: string,
|
||||
options?: ParseOptions
|
||||
): CommandEntry[];
|
||||
@@ -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",
|
||||
"docker-file-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,30 @@
|
||||
import * as fs from 'fs';
|
||||
import download = require('download');
|
||||
|
||||
download('http://unicorn.com/foo.jpg', 'dist').then(() => {
|
||||
console.log('done!');
|
||||
});
|
||||
|
||||
download('http://unicorn.com/foo.jpg').then(data => {
|
||||
fs.writeFileSync('dist/foo.jpg', data);
|
||||
});
|
||||
|
||||
download('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));
|
||||
|
||||
download('unicorn.com/foo.jpg', 'dest', {
|
||||
body: '',
|
||||
decompress: true,
|
||||
encoding: 'utf8',
|
||||
extract: true,
|
||||
filename: 'filename',
|
||||
followRedirect: true,
|
||||
proxy: '',
|
||||
query: '',
|
||||
retries: (retry: number, error: any) => 4,
|
||||
timeout: {
|
||||
connect: 20,
|
||||
request: 20,
|
||||
socket: 20
|
||||
},
|
||||
useElectronNet: true
|
||||
});
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for download 6.2
|
||||
// Project: https://github.com/kevva/download
|
||||
// Definitions by: Nico Jansen <https://github.com/nicojs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
interface TimeoutOptions {
|
||||
connect?: number;
|
||||
socket?: number;
|
||||
request?: number;
|
||||
}
|
||||
type RetryFunction = (retry: number, error: any) => number;
|
||||
|
||||
interface DownloadOptions {
|
||||
body?: string | Buffer | NodeJS.ReadableStream;
|
||||
encoding?: string | null;
|
||||
query?: string | object;
|
||||
timeout?: number | TimeoutOptions;
|
||||
retries?: number | RetryFunction;
|
||||
followRedirect?: boolean;
|
||||
decompress?: boolean;
|
||||
useElectronNet?: boolean;
|
||||
/**
|
||||
* If set to true, try extracting the file using decompress.
|
||||
*/
|
||||
extract?: boolean;
|
||||
/**
|
||||
* Name of the saved file.
|
||||
*/
|
||||
filename?: string;
|
||||
/**
|
||||
* Proxy endpoint
|
||||
*/
|
||||
proxy?: string;
|
||||
}
|
||||
|
||||
declare function download(url: string, destination?: string, options?: DownloadOptions): Promise<Buffer> & NodeJS.WritableStream & NodeJS.ReadableStream;
|
||||
|
||||
export = download;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"download-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -12,7 +12,17 @@ import {
|
||||
SelectionState,
|
||||
getDefaultKeyBinding,
|
||||
ContentState,
|
||||
convertFromHTML
|
||||
RawDraftInlineStyleRange,
|
||||
RawDraftEntityRange,
|
||||
RawDraftEntity,
|
||||
RawDraftContentBlock,
|
||||
RawDraftContentState,
|
||||
DraftBlockType,
|
||||
DraftInlineStyleType,
|
||||
DraftEntityMutability,
|
||||
DraftEntityType,
|
||||
convertFromHTML,
|
||||
convertToRaw
|
||||
} from 'draft-js';
|
||||
|
||||
const SPLIT_HEADER_BLOCK = 'split-header-block';
|
||||
@@ -274,7 +284,7 @@ var INLINE_STYLES = [
|
||||
|
||||
const InlineStyleControls = (props: {editorState: EditorState, onToggle: (blockType: string) => void}) => {
|
||||
var currentStyle = props.editorState.getCurrentInlineStyle();
|
||||
return (
|
||||
return (
|
||||
<div className="RichEditor-controls">
|
||||
{INLINE_STYLES.map(type =>
|
||||
<StyleButton
|
||||
@@ -293,3 +303,23 @@ ReactDOM.render(
|
||||
<RichEditorExample />,
|
||||
document.getElementById('target')
|
||||
);
|
||||
|
||||
const editorState = EditorState.createEmpty();
|
||||
const contentState = editorState.getCurrentContent();
|
||||
const rawContentState: RawDraftContentState = convertToRaw(contentState);
|
||||
|
||||
rawContentState.blocks.forEach((block: RawDraftContentBlock) => {
|
||||
block.entityRanges.forEach((entityRange: RawDraftEntityRange) => {
|
||||
const { key, offset, length } = entityRange;
|
||||
const entity: RawDraftEntity = rawContentState.entityMap[key];
|
||||
const entityType: DraftEntityType = entity.type;
|
||||
const entityMutability: DraftEntityMutability = entity.mutability;
|
||||
console.log(entityType, entityMutability, offset, length);
|
||||
});
|
||||
|
||||
block.inlineStyleRanges.forEach((inlineStyleRange: RawDraftInlineStyleRange) => {
|
||||
const { offset, length } = inlineStyleRange
|
||||
const inlineStyle: DraftInlineStyleType = inlineStyleRange.style;
|
||||
console.log(inlineStyle, offset, length);
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+92
-50
@@ -262,9 +262,10 @@ declare namespace Draft {
|
||||
* or block types.
|
||||
*/
|
||||
"bold" |
|
||||
"italic" |
|
||||
"underline" |
|
||||
"code" |
|
||||
"italic" |
|
||||
"strikethrough" |
|
||||
"underline" |
|
||||
|
||||
/**
|
||||
* Split a block in two.
|
||||
@@ -328,6 +329,60 @@ declare namespace Draft {
|
||||
* another fragment or if the selected fragment shall be replaced
|
||||
*/
|
||||
type DraftInsertionType = "replace" | "before" | "after";
|
||||
|
||||
/**
|
||||
* Valid inline styles.
|
||||
*/
|
||||
type DraftInlineStyleType = (
|
||||
"BOLD" |
|
||||
"CODE" |
|
||||
"ITALIC" |
|
||||
"STRIKETHROUGH" |
|
||||
"UNDERLINE"
|
||||
)
|
||||
|
||||
/**
|
||||
* Default entity types.
|
||||
*/
|
||||
type ComposedEntityType = (
|
||||
"LINK" |
|
||||
"TOKEN" |
|
||||
"PHOTO" |
|
||||
"IMAGE"
|
||||
)
|
||||
|
||||
/**
|
||||
* Possible entity types.
|
||||
*/
|
||||
type DraftEntityType = string | ComposedEntityType;
|
||||
|
||||
/**
|
||||
* Possible "mutability" options for an entity. This refers to the behavior
|
||||
* that should occur when inserting or removing characters in a text range
|
||||
* with an entity applied to it.
|
||||
*
|
||||
* `MUTABLE`:
|
||||
* The text range can be modified freely. Generally used in cases where
|
||||
* the text content and the entity do not necessarily have a direct
|
||||
* relationship. For instance, the text and URI for a link may be completely
|
||||
* different. The user is allowed to edit the text as needed, and the entity
|
||||
* is preserved and applied to any characters added within the range.
|
||||
*
|
||||
* `IMMUTABLE`:
|
||||
* Not to be confused with immutable data structures used to represent the
|
||||
* state of the editor. Immutable entity ranges cannot be modified in any
|
||||
* way. Adding characters within the range will remove the entity from the
|
||||
* entire range. Deleting characters will delete the entire range. Example:
|
||||
* Facebook Page mentions.
|
||||
*
|
||||
* `SEGMENTED`:
|
||||
* Segmented entities allow the removal of partial ranges of text, as
|
||||
* separated by a delimiter. Adding characters wihin the range will remove
|
||||
* the entity from the entire range. Deleting characters within a segmented
|
||||
* entity will delete only the segments affected by the deletion. Example:
|
||||
* Facebook User mentions.
|
||||
*/
|
||||
type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED";
|
||||
}
|
||||
|
||||
namespace Decorators {
|
||||
@@ -408,14 +463,24 @@ declare namespace Draft {
|
||||
}
|
||||
|
||||
namespace Encoding {
|
||||
import DraftInlineStyleType = Draft.Model.Constants.DraftInlineStyleType;
|
||||
import DraftBlockType = Draft.Model.Constants.DraftBlockType;
|
||||
import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability;
|
||||
import DraftEntityType = Draft.Model.Constants.DraftEntityType;
|
||||
|
||||
import ContentBlock = Draft.Model.ImmutableData.ContentBlock;
|
||||
import ContentState = Draft.Model.ImmutableData.ContentState;
|
||||
|
||||
import DraftBlockRenderMap = Draft.Component.Base.DraftBlockRenderMap;
|
||||
import DraftBlockType = Draft.Model.Constants.DraftBlockType;
|
||||
|
||||
import DraftEntityType = Draft.Model.Entity.DraftEntityType;
|
||||
import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability;
|
||||
/**
|
||||
* A plain object representation of an inline style range.
|
||||
*/
|
||||
interface RawDraftInlineStyleRange {
|
||||
style: DraftInlineStyleType;
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A plain object representation of an entity attribution.
|
||||
@@ -423,21 +488,12 @@ declare namespace Draft {
|
||||
* The `key` value corresponds to the key of the entity in the `entityMap` of
|
||||
* a `ComposedText` object, not for use with `DraftEntity.get()`.
|
||||
*/
|
||||
interface EntityRange {
|
||||
interface RawDraftEntityRange {
|
||||
key: number,
|
||||
offset: number,
|
||||
length: number,
|
||||
}
|
||||
|
||||
/**
|
||||
* A plain object representation of an inline style range.
|
||||
*/
|
||||
interface InlineStyleRange {
|
||||
style: string;
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A plain object representation of an EntityInstance.
|
||||
*/
|
||||
@@ -456,8 +512,8 @@ declare namespace Draft {
|
||||
type: DraftBlockType;
|
||||
text: string;
|
||||
depth: number;
|
||||
inlineStyleRanges: Array<InlineStyleRange>;
|
||||
entityRanges: Array<EntityRange>;
|
||||
inlineStyleRanges: Array<RawDraftInlineStyleRange>;
|
||||
entityRanges: Array<RawDraftEntityRange>;
|
||||
data?: Object;
|
||||
}
|
||||
|
||||
@@ -481,36 +537,8 @@ declare namespace Draft {
|
||||
}
|
||||
|
||||
namespace Entity {
|
||||
type ComposedEntityType = "LINK" | "TOKEN" | "PHOTO";
|
||||
type DraftEntityType = string | ComposedEntityType;
|
||||
|
||||
/**
|
||||
* An enum representing the possible "mutability" options for an entity.
|
||||
* This refers to the behavior that should occur when inserting or removing
|
||||
* characters in a text range with an entity applied to it.
|
||||
*
|
||||
* `MUTABLE`:
|
||||
* The text range can be modified freely. Generally used in cases where
|
||||
* the text content and the entity do not necessarily have a direct
|
||||
* relationship. For instance, the text and URI for a link may be completely
|
||||
* different. The user is allowed to edit the text as needed, and the entity
|
||||
* is preserved and applied to any characters added within the range.
|
||||
*
|
||||
* `IMMUTABLE`:
|
||||
* Not to be confused with immutable data structures used to represent the
|
||||
* state of the editor. Immutable entity ranges cannot be modified in any
|
||||
* way. Adding characters within the range will remove the entity from the
|
||||
* entire range. Deleting characters will delete the entire range. Example:
|
||||
* Facebook Page mentions.
|
||||
*
|
||||
* `SEGMENTED`:
|
||||
* Segmented entities allow the removal of partial ranges of text, as
|
||||
* separated by a delimiter. Adding characters wihin the range will remove
|
||||
* the entity from the entire range. Deleting characters within a segmented
|
||||
* entity will delete only the segments affected by the deletion. Example:
|
||||
* Facebook User mentions.
|
||||
*/
|
||||
type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED";
|
||||
import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability;
|
||||
import DraftEntityType = Draft.Model.Constants.DraftEntityType;
|
||||
|
||||
/**
|
||||
* A "document entity" is an object containing metadata associated with a
|
||||
@@ -579,10 +607,10 @@ declare namespace Draft {
|
||||
|
||||
namespace ImmutableData {
|
||||
import DraftBlockType = Draft.Model.Constants.DraftBlockType;
|
||||
import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType;
|
||||
import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability;
|
||||
import DraftEntityType = Draft.Model.Constants.DraftEntityType;
|
||||
|
||||
import DraftEntityType = Draft.Model.Entity.DraftEntityType;
|
||||
import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability;
|
||||
import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType;
|
||||
|
||||
type DraftInlineStyle = Immutable.OrderedSet<string>;
|
||||
type BlockMap = Immutable.OrderedMap<string, Draft.Model.ImmutableData.ContentBlock>;
|
||||
@@ -938,6 +966,10 @@ import RichUtils = Draft.Model.Modifier.RichTextEditorUtil;
|
||||
import DefaultDraftBlockRenderMap = Draft.Model.ImmutableData.DefaultDraftBlockRenderMap;
|
||||
import DefaultDraftInlineStyle = Draft.Model.ImmutableData.DefaultDraftInlineStyle;
|
||||
|
||||
import RawDraftInlineStyleRange = Draft.Model.Encoding.RawDraftInlineStyleRange;
|
||||
import RawDraftEntityRange = Draft.Model.Encoding.RawDraftEntityRange;
|
||||
import RawDraftEntity = Draft.Model.Encoding.RawDraftEntity;
|
||||
import RawDraftContentBlock = Draft.Model.Encoding.RawDraftContentBlock;
|
||||
import RawDraftContentState = Draft.Model.Encoding.RawDraftContentState;
|
||||
import convertFromRaw = Draft.Model.Encoding.convertFromRawToDraftState;
|
||||
import convertToRaw = Draft.Model.Encoding.convertFromDraftStateToRaw;
|
||||
@@ -950,6 +982,9 @@ import getVisibleSelectionRect = Draft.Component.Selection.getVisibleSelectionRe
|
||||
import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand;
|
||||
import DraftDragType = Draft.Model.Constants.DraftDragType;
|
||||
import DraftBlockType = Draft.Model.Constants.DraftBlockType;
|
||||
import DraftInlineStyleType = Draft.Model.Constants.DraftInlineStyleType;
|
||||
import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability;
|
||||
import DraftEntityType = Draft.Model.Constants.DraftEntityType;
|
||||
import DraftRemovalDirection = Draft.Model.Constants.DraftRemovalDirection;
|
||||
import DraftHandleValue = Draft.Model.Constants.DraftHandleValue;
|
||||
import DraftInsertionType = Draft.Model.Constants.DraftInsertionType;
|
||||
@@ -979,6 +1014,10 @@ export {
|
||||
DefaultDraftBlockRenderMap,
|
||||
DefaultDraftInlineStyle,
|
||||
|
||||
RawDraftInlineStyleRange,
|
||||
RawDraftEntityRange,
|
||||
RawDraftEntity,
|
||||
RawDraftContentBlock,
|
||||
RawDraftContentState,
|
||||
convertFromRaw,
|
||||
convertToRaw,
|
||||
@@ -991,6 +1030,9 @@ export {
|
||||
DraftEditorCommand,
|
||||
DraftDragType,
|
||||
DraftBlockType,
|
||||
DraftInlineStyleType,
|
||||
DraftEntityType,
|
||||
DraftEntityMutability,
|
||||
DraftRemovalDirection,
|
||||
DraftHandleValue,
|
||||
DraftInsertionType,
|
||||
|
||||
Vendored
+6
@@ -526,6 +526,12 @@ declare namespace dygraphs {
|
||||
*/
|
||||
highlightSeriesBackgroundAlpha?: number;
|
||||
|
||||
/**
|
||||
* Sets the background color used to fade out the series in conjunction with 'highlightSeriesBackgroundAlpha'.
|
||||
* Default: rgb(255, 255, 255)
|
||||
*/
|
||||
highlightSeriesBackgroundColor?: string;
|
||||
|
||||
/**
|
||||
* When set, the options from this object are applied to the timeseries closest to the mouse
|
||||
* pointer for interactive highlighting. See also 'highlightCallback'. Example:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import elasticsearch = require("elasticsearch");
|
||||
import * as elasticsearch from "elasticsearch";
|
||||
|
||||
var client = new elasticsearch.Client({
|
||||
let client = new elasticsearch.Client({
|
||||
host: 'localhost:9200',
|
||||
log: 'trace'
|
||||
});
|
||||
@@ -10,26 +10,26 @@ client = new elasticsearch.Client({
|
||||
'box1.server.org',
|
||||
'box2.server.org'
|
||||
],
|
||||
selector: function (hosts: any) { }
|
||||
selector: (hosts: any) => { }
|
||||
});
|
||||
|
||||
client.ping({
|
||||
requestTimeout: 30000
|
||||
}, function (error) {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.search({
|
||||
q: 'pants'
|
||||
}).then(function (body) {
|
||||
var hits = body.hits.hits;
|
||||
}, function (error) {
|
||||
}).then((body) => {
|
||||
const hits = body.hits.hits;
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.indices.delete({
|
||||
index: 'test_index',
|
||||
ignore: [404]
|
||||
}).then(function (body) {
|
||||
}, function (error) {
|
||||
}).then((body) => {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.deleteByQuery({
|
||||
@@ -39,8 +39,8 @@ client.deleteByQuery({
|
||||
query: {
|
||||
}
|
||||
}
|
||||
}).then(function (response) {
|
||||
}, function (error) {
|
||||
}).then((response) => {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.create({
|
||||
@@ -103,7 +103,7 @@ client.cluster.stats({
|
||||
|
||||
client.count({
|
||||
index: 'index_name'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -120,7 +120,7 @@ client.count({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (err, response) {
|
||||
}, (err, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ client.explain({
|
||||
|
||||
// the query to score it against
|
||||
q: 'field:value'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -145,7 +145,7 @@ client.explain({
|
||||
match: { title: 'test' }
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -158,8 +158,7 @@ client.index({
|
||||
tags: ['y', 'z'],
|
||||
published: true,
|
||||
}
|
||||
}, function (error, response) {
|
||||
|
||||
}, (error, response) => {
|
||||
});
|
||||
|
||||
client.mget({
|
||||
@@ -170,7 +169,7 @@ client.mget({
|
||||
{ _index: 'indexC', _type: 'typeC', _id: '1' }
|
||||
]
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -180,14 +179,14 @@ client.mget({
|
||||
body: {
|
||||
ids: [1, 2, 3]
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
client.search({
|
||||
index: 'myindex',
|
||||
q: 'title:test'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -207,7 +206,7 @@ client.search({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -221,12 +220,11 @@ client.suggest({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
});
|
||||
|
||||
|
||||
// first we do a search, and specify a scroll timeout
|
||||
var allTitles: string[] = [];
|
||||
const allTitles: string[] = [];
|
||||
client.search({
|
||||
index: 'myindex',
|
||||
// Set to 30 seconds because we are calling right back
|
||||
@@ -236,14 +234,14 @@ client.search({
|
||||
q: 'title:test'
|
||||
}, function getMoreUntilDone(error, response) {
|
||||
// collect the title from each response
|
||||
response.hits.hits.forEach(function (hit) {
|
||||
response.hits.hits.forEach((hit) => {
|
||||
allTitles.push(hit.fields.title);
|
||||
});
|
||||
|
||||
if (response.hits.total !== allTitles.length) {
|
||||
// now we can call scroll over and over
|
||||
client.scroll({
|
||||
scrollId: response._scroll_id,
|
||||
scrollId: response._scroll_id!,
|
||||
scroll: '30s'
|
||||
}, getMoreUntilDone);
|
||||
} else {
|
||||
@@ -258,8 +256,13 @@ client.indices.updateAliases({
|
||||
{ add: { index: 'logstash-2014.05', alias: 'logstash-current' } }
|
||||
]
|
||||
}
|
||||
}).then(function (response) {
|
||||
}).then((response) => {
|
||||
// ...
|
||||
}, function (error) {
|
||||
}, (error) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
// Errors
|
||||
function testErrors() {
|
||||
throw new elasticsearch.errors.AuthenticationException();
|
||||
}
|
||||
|
||||
Vendored
+1605
-1554
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -21,4 +21,4 @@
|
||||
"index.d.ts",
|
||||
"elasticsearch-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
"no-empty-interface": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1693
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
const JsonApi = DS.JSONAPIAdapter.extend({
|
||||
// Application specific overrides go here
|
||||
});
|
||||
|
||||
const Customized = DS.JSONAPIAdapter.extend({
|
||||
host: 'https://api.example.com',
|
||||
namespace: 'api/v1',
|
||||
headers: {
|
||||
'API_KEY': 'secret key',
|
||||
'ANOTHER_HEADER': 'Some header value'
|
||||
}
|
||||
});
|
||||
|
||||
const AuthTokenHeader = DS.JSONAPIAdapter.extend({
|
||||
session: Ember.inject.service('session'),
|
||||
headers: Ember.computed('session.authToken', function() {
|
||||
return {
|
||||
'API_KEY': this.get('session.authToken'),
|
||||
'ANOTHER_HEADER': 'Some header value'
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
const UseAjax = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
return this.ajax(url, 'POST', {
|
||||
param: 'foo'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const UseAjaxOptions = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
const options = this.ajaxOptions(url, 'DELETE', {
|
||||
foo: 'bar'
|
||||
});
|
||||
return Ember.$.ajax(url, {
|
||||
...options
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const UseAjaxOptionsWithOptionalThirdParams = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
const options = this.ajaxOptions(url, 'DELETE');
|
||||
return Ember.$.ajax(url, {
|
||||
...options
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
class Folder extends DS.Model {
|
||||
name = DS.attr('string');
|
||||
children = DS.hasMany<Folder>('folder', { inverse: 'parent' });
|
||||
parent = DS.belongsTo<Folder>('folder', { inverse: 'children' });
|
||||
}
|
||||
|
||||
const folder = Folder.create();
|
||||
assertType<Folder>(folder.get('parent'));
|
||||
assertType<string>(folder.get('parent').get('name'));
|
||||
folder.get('parent').then(parent => {
|
||||
assertType<Folder>(parent);
|
||||
assertType<string>(parent.get('name'));
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
class Comment extends DS.Model {
|
||||
text = DS.attr('string');
|
||||
}
|
||||
|
||||
class BlogPost extends DS.Model {
|
||||
title = DS.attr('string');
|
||||
commentsAsync = DS.hasMany<Comment>('comment');
|
||||
commentsSync = DS.hasMany<Comment>('comment', { async: false });
|
||||
}
|
||||
|
||||
const post = BlogPost.create();
|
||||
|
||||
assertType<DS.PromiseArray<Comment>>(post.get('commentsSync').reload());
|
||||
assertType<Comment>(post.get('commentsSync').createRecord());
|
||||
|
||||
const comment = post.get('commentsSync').get('firstObject');
|
||||
assertType<Comment | undefined>(comment);
|
||||
if (comment) {
|
||||
assertType<string>(comment.get('text'));
|
||||
}
|
||||
|
||||
assertType<DS.PromiseArray<Comment>>(post.get('commentsAsync').reload());
|
||||
assertType<Comment>(post.get('commentsAsync').createRecord());
|
||||
assertType<Comment | undefined>(post.get('commentsAsync').get('firstObject'));
|
||||
|
||||
const commentAsync = post.get('commentsAsync').get('firstObject');
|
||||
assertType<Comment | undefined>(commentAsync);
|
||||
if (commentAsync) {
|
||||
assertType<string>(commentAsync.get('text'));
|
||||
}
|
||||
assertType<boolean>(post.get('commentsAsync').get('isFulfilled'));
|
||||
|
||||
post.get('commentsAsync').then(comments => {
|
||||
assertType<Comment | undefined>(comments.get('firstObject'));
|
||||
assertType<string>(comments.get('firstObject')!.get('text'));
|
||||
});
|
||||
|
||||
class Polymorphic extends DS.Model {
|
||||
paymentMethods = DS.hasMany('payment-method', { polymorphic: true });
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
Ember.Route.extend({
|
||||
model(): any {
|
||||
return this.store.findAll('my-model');
|
||||
}
|
||||
});
|
||||
|
||||
Ember.Controller.extend({
|
||||
actions: {
|
||||
create(): any {
|
||||
return this.store.createRecord('my-model');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Ember.DataAdapter.extend({
|
||||
test() {
|
||||
this.store.findRecord('my-model', 123);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
/** Static assertion that `value` has type `T` */
|
||||
export declare function assertType<T>(value: T): void;
|
||||
@@ -0,0 +1,29 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from "./lib/assert";
|
||||
|
||||
const Person = DS.Model.extend({
|
||||
firstName: DS.attr(),
|
||||
lastName: DS.attr(),
|
||||
title: DS.attr({ defaultValue: "The default" }),
|
||||
title2: DS.attr({ defaultValue: () => "The default" }),
|
||||
|
||||
fullName: Ember.computed('firstName', 'lastName', function() {
|
||||
return `${this.get('firstName')} ${this.get('lastName')}`;
|
||||
})
|
||||
});
|
||||
|
||||
const User = DS.Model.extend({
|
||||
username: DS.attr('string'),
|
||||
email: DS.attr('string'),
|
||||
verified: DS.attr('boolean', { defaultValue: false }),
|
||||
createdAt: DS.attr('date', {
|
||||
defaultValue() { return new Date(); }
|
||||
})
|
||||
});
|
||||
|
||||
const user = User.create({ username: 'dwickern' });
|
||||
assertType<string>(user.get('id'));
|
||||
assertType<string>(user.get('username'));
|
||||
assertType<boolean>(user.get('verified'));
|
||||
assertType<Date>(user.get('createdAt'));
|
||||
@@ -0,0 +1,38 @@
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from "./lib/assert";
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
class User extends DS.Model {
|
||||
username = DS.attr('string');
|
||||
}
|
||||
|
||||
let userRef = store.getReference<User>('user', 1);
|
||||
|
||||
// get the record of the reference (null if not yet available)
|
||||
let user = userRef.value();
|
||||
if (user !== null) {
|
||||
assertType<User>(user);
|
||||
}
|
||||
|
||||
// get the identifier of the reference
|
||||
if (userRef.remoteType() === 'id') {
|
||||
let id = userRef.id();
|
||||
assertType<string>(id);
|
||||
}
|
||||
|
||||
// load user (via store.find)
|
||||
userRef.load().then(user => {
|
||||
assertType<User>(user);
|
||||
});
|
||||
|
||||
// or trigger a reload
|
||||
userRef.reload().then(user => {
|
||||
assertType<User>(user);
|
||||
});
|
||||
|
||||
// provide data for reference
|
||||
userRef.push({ id: 1, username: '@user' }).then(function(user) {
|
||||
assertType<User>(user);
|
||||
userRef.value() === user;
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
const Person = DS.Model.extend({
|
||||
children: DS.hasMany('folder', { inverse: 'parent' }),
|
||||
parent: DS.belongsTo('folder', { inverse: 'children' })
|
||||
});
|
||||
|
||||
const Polymorphic = DS.Model.extend({
|
||||
paymentMethods: DS.hasMany('payment-method', { polymorphic: true })
|
||||
});
|
||||
|
||||
class Comment extends DS.Model {
|
||||
author = DS.attr('string');
|
||||
}
|
||||
|
||||
class BlogPost extends DS.Model {
|
||||
title = DS.attr('string');
|
||||
tag = DS.attr('string');
|
||||
comments = DS.hasMany<Comment>('comment', { async: true });
|
||||
relatedPosts = DS.hasMany('post');
|
||||
}
|
||||
|
||||
let blogPost = store.peekRecord<BlogPost>('blog-post', 1);
|
||||
blogPost!.get('comments').then((comments) => {
|
||||
// now we can work with the comments
|
||||
let author: string = comments.get('firstObject')!.get('author');
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
const JsonApi = DS.JSONAPISerializer.extend({});
|
||||
|
||||
const Customized = DS.JSONAPISerializer.extend({
|
||||
serialize(snapshot: DS.Snapshot, options: {}) {
|
||||
let json: any = this._super(...Array.from(arguments));
|
||||
|
||||
json.data.attributes.cost = {
|
||||
amount: json.data.attributes.amount,
|
||||
currency: json.data.attributes.currency
|
||||
};
|
||||
|
||||
return json;
|
||||
},
|
||||
normalizeResponse(store: DS.Store, primaryModelClass: DS.Model, payload: any, id: string|number, requestType: string) {
|
||||
payload.data.attributes.amount = payload.data.attributes.cost.amount;
|
||||
payload.data.attributes.currency = payload.data.attributes.cost.currency;
|
||||
|
||||
delete payload.data.attributes.cost;
|
||||
|
||||
return this._super(...Array.from(arguments));
|
||||
}
|
||||
});
|
||||
|
||||
const EmbeddedRecordMixin = DS.JSONSerializer.extend(DS.EmbeddedRecordsMixin, {
|
||||
attrs: {
|
||||
author: {
|
||||
serialize: false,
|
||||
deserialize: 'records'
|
||||
},
|
||||
comments: {
|
||||
deserialize: 'records',
|
||||
serialize: 'ids'
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,119 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from "./lib/assert";
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
class Post extends DS.Model {
|
||||
title = DS.attr('string');
|
||||
}
|
||||
|
||||
let post = store.createRecord<Post>('post', {
|
||||
title: 'Rails is Omakase',
|
||||
body: 'Lorem ipsum'
|
||||
});
|
||||
|
||||
post.save(); // => POST to '/posts'
|
||||
post.save().then((saved) => {
|
||||
assertType<Post>(saved);
|
||||
});
|
||||
|
||||
store.findRecord<Post>('post', 1).then(function(post) {
|
||||
post.get('title'); // => "Rails is Omakase"
|
||||
post.set('title', 'A new post');
|
||||
post.save(); // => PATCH to '/posts/1'
|
||||
});
|
||||
|
||||
class User extends DS.Model {
|
||||
username = DS.attr('string');
|
||||
}
|
||||
|
||||
store.queryRecord<User>('user', {}).then(function(user) {
|
||||
let username = user.get('username');
|
||||
console.log(`Currently logged in as ${username}`);
|
||||
});
|
||||
|
||||
store.findAll('blog-post'); // => GET /blog-posts
|
||||
store.findAll('author', { reload: true }).then(function(authors) {
|
||||
authors.getEach('id'); // ['first', 'second']
|
||||
});
|
||||
store.findAll('post', {
|
||||
adapterOptions: { subscribe: false }
|
||||
});
|
||||
store.findAll('post', { include: 'comments,comments.author' });
|
||||
|
||||
store.peekAll('blog-post'); // => no network request
|
||||
|
||||
if (store.hasRecordForId('post', 1)) {
|
||||
let maybePost = store.peekRecord('post', 1);
|
||||
if (maybePost) {
|
||||
maybePost.get('id'); // 1
|
||||
}
|
||||
}
|
||||
|
||||
class Message extends DS.Model {
|
||||
hasBeenSeen = DS.attr('boolean');
|
||||
}
|
||||
|
||||
const messages = store.peekAll<Message>('message');
|
||||
messages.forEach(function(message) {
|
||||
message.set('hasBeenSeen', true);
|
||||
});
|
||||
messages.save();
|
||||
|
||||
const people = store.peekAll('person');
|
||||
people.get('isUpdating'); // false
|
||||
people.update().then(function() {
|
||||
people.get('isUpdating'); // false
|
||||
});
|
||||
people.get('isUpdating'); // true
|
||||
|
||||
const MyRoute = Ember.Route.extend({
|
||||
model(params: any): any {
|
||||
return this.store.findRecord('post', params.post_id, {include: 'comments,comments.author'});
|
||||
}
|
||||
});
|
||||
|
||||
// GET to /users?filter[email]=tomster@example.com
|
||||
const tom = store.query('user', {
|
||||
filter: {
|
||||
email: 'tomster@example.com'
|
||||
}
|
||||
}).then(function(users) {
|
||||
return users.get("firstObject");
|
||||
});
|
||||
|
||||
// GET /users?isAdmin=true
|
||||
const admins = store.query('user', { isAdmin: true });
|
||||
admins.then(function() {
|
||||
console.log(admins.get("length")); // 42
|
||||
});
|
||||
admins.update().then(function() {
|
||||
admins.get('isUpdating'); // false
|
||||
console.log(admins.get("length")); // 123
|
||||
});
|
||||
|
||||
store.push({
|
||||
data: [{
|
||||
id: 1,
|
||||
type: 'album',
|
||||
attributes: {
|
||||
title: 'Fewer Moving Parts',
|
||||
artist: 'David Bazan',
|
||||
songCount: 10
|
||||
},
|
||||
relationships: {}
|
||||
}, {
|
||||
id: 2,
|
||||
type: 'album',
|
||||
attributes: {
|
||||
title: 'Calgary b/w I Can\'t Make You Love Me/Nick Of Time',
|
||||
artist: 'Bon Iver',
|
||||
songCount: 2
|
||||
},
|
||||
relationships: {}
|
||||
}]
|
||||
});
|
||||
|
||||
assertType<DS.Adapter>(store.adapterFor('person'));
|
||||
assertType<DS.Serializer>(store.serializerFor('person'));
|
||||
@@ -0,0 +1,16 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
class Point extends Ember.Object {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
const PointTransform = DS.Transform.extend({
|
||||
serialize(value: Point): number[] {
|
||||
return [value.get('x'), value.get('y')];
|
||||
},
|
||||
deserialize(value: [ number, number ]): Point {
|
||||
return Point.create({ x: value[0], y: value[1] });
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/lib/assert.ts",
|
||||
"test/model.ts",
|
||||
"test/adapter.ts",
|
||||
"test/serializer.ts",
|
||||
"test/transform.ts",
|
||||
"test/relationships.ts",
|
||||
"test/store.ts",
|
||||
"test/has-many.ts",
|
||||
"test/belongs-to.ts",
|
||||
"test/record-reference.ts",
|
||||
"test/injections.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// Heavy use of Function type in this older package.
|
||||
"ban-types": false,
|
||||
"jsdoc-format": false,
|
||||
"no-misused-new": false,
|
||||
// not sure what this means
|
||||
"no-single-declare-module": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-const": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
Vendored
+3
-1
@@ -558,6 +558,8 @@ declare module 'ember' {
|
||||
**/
|
||||
interface ArrayProxy<T> extends MutableArray<T> {}
|
||||
class ArrayProxy<T> extends Object.extend(MutableArray as {}) {
|
||||
content: NativeArray<T>;
|
||||
|
||||
/**
|
||||
* Should actually retrieve the object at the specified index from the
|
||||
* content. You can override this method in subclasses to transform the
|
||||
@@ -1837,7 +1839,7 @@ declare module 'ember' {
|
||||
* A hook you can implement to convert the URL into the model for
|
||||
* this route.
|
||||
*/
|
||||
model<T>(params: {}, transition: Transition): T | Rsvp.Promise<T>;
|
||||
model(params: {}, transition: Transition): any;
|
||||
|
||||
/**
|
||||
* Returns the model of a parent (or any ancestor) route
|
||||
|
||||
Executable → Regular
+3
-4
@@ -21,7 +21,6 @@ class MyNewProxy<T> extends Ember.ArrayProxy<T> {
|
||||
isNew = true;
|
||||
}
|
||||
|
||||
let x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) });
|
||||
// TODO: type inference can't infer 'number', just '{}'
|
||||
// x.get('firstObject'); // $ExpectType number | undefined
|
||||
x.isNew; // $ExpectType boolean
|
||||
let x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }) as MyNewProxy<number>;
|
||||
assertType<number | undefined>(x.get('firstObject'));
|
||||
assertType<boolean>(x.isNew);
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
import * as React from "react";
|
||||
import { shallow, mount, render, ShallowWrapper, ReactWrapper } from "enzyme";
|
||||
import {
|
||||
shallow,
|
||||
mount,
|
||||
render,
|
||||
ShallowWrapper,
|
||||
ReactWrapper,
|
||||
configure,
|
||||
EnzymeAdapter,
|
||||
ShallowRendererProps,
|
||||
} from "enzyme";
|
||||
import { Component, ReactElement, HTMLAttributes, ComponentClass, StatelessComponent } from "react";
|
||||
|
||||
// Help classes/interfaces
|
||||
@@ -24,6 +33,18 @@ class MyComponent extends Component<MyComponentProps, MyComponentState> {
|
||||
|
||||
const MyStatelessComponent = (props: StatelessProps) => <span />;
|
||||
|
||||
// Enzyme.configure
|
||||
function configureTest() {
|
||||
const configureAdapter: { adapter: EnzymeAdapter } = { adapter: {} };
|
||||
configure(configureAdapter);
|
||||
|
||||
const configureAdapterAndDisableLifecycle: typeof configureAdapter & Pick<ShallowRendererProps, "disableLifecycleMethods"> = {
|
||||
adapter: {},
|
||||
disableLifecycleMethods: true,
|
||||
};
|
||||
configure(configureAdapterAndDisableLifecycle);
|
||||
}
|
||||
|
||||
// ShallowWrapper
|
||||
function ShallowWrapperTest() {
|
||||
let shallowWrapper: ShallowWrapper<MyComponentProps, MyComponentState> =
|
||||
@@ -50,7 +71,8 @@ function ShallowWrapperTest() {
|
||||
context: {
|
||||
test: "a",
|
||||
},
|
||||
lifecycleExperimental: true
|
||||
lifecycleExperimental: true,
|
||||
disableLifecycleMethods: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+17
-1
@@ -551,6 +551,12 @@ export class ReactWrapper<P = {}, S = {}> {
|
||||
}
|
||||
|
||||
export interface ShallowRendererProps {
|
||||
// See https://github.com/airbnb/enzyme/blob/enzyme@3.1.1/docs/api/shallow.md#arguments
|
||||
/**
|
||||
* If set to true, componentDidMount is not called on the component, and componentDidUpdate is not called after
|
||||
* setProps and setContext. Default to false.
|
||||
*/
|
||||
disableLifecycleMethods?: boolean;
|
||||
/**
|
||||
* Enable experimental support for full react lifecycle methods
|
||||
*/
|
||||
@@ -602,4 +608,14 @@ export class EnzymeAdapter {
|
||||
* Configure enzyme to use the correct adapter for the react verstion
|
||||
* This is enabling the Enzyme configuration with adapters in TS
|
||||
*/
|
||||
export function configure(options: { adapter: EnzymeAdapter }): void;
|
||||
export function configure(options: {
|
||||
adapter: EnzymeAdapter,
|
||||
// See https://github.com/airbnb/enzyme/blob/enzyme@3.1.1/docs/guides/migration-from-2-to-3.md#lifecycle-methods
|
||||
// Actually, `{adapter:} & Pick<ShallowRendererProps,"disableLifecycleMethods">` is more precise. However,
|
||||
// in that case jsdoc won't be shown
|
||||
/**
|
||||
* If set to true, componentDidMount is not called on the component, and componentDidUpdate is not called after
|
||||
* setProps and setContext. Default to false.
|
||||
*/
|
||||
disableLifecycleMethods?: boolean;
|
||||
}): void;
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import {
|
||||
Accelerometer,
|
||||
Amplitude,
|
||||
Asset,
|
||||
AuthSession,
|
||||
Audio,
|
||||
AppLoading,
|
||||
BarCodeScanner,
|
||||
BlurViewProps,
|
||||
BlurView,
|
||||
Brightness,
|
||||
Camera,
|
||||
DocumentPicker,
|
||||
Facebook,
|
||||
FacebookAds,
|
||||
FileSystem
|
||||
} from 'expo';
|
||||
|
||||
Accelerometer.addListener((obj) => {
|
||||
obj.x;
|
||||
obj.y;
|
||||
obj.z;
|
||||
});
|
||||
Accelerometer.removeAllListeners();
|
||||
Accelerometer.setUpdateInterval(1000);
|
||||
|
||||
Amplitude.initialize('key');
|
||||
Amplitude.setUserId('userId');
|
||||
Amplitude.setUserProperties({key: 1});
|
||||
Amplitude.clearUserProperties();
|
||||
Amplitude.logEvent('name');
|
||||
Amplitude.logEventWithProperties('event', {key: 'value'});
|
||||
Amplitude.setGroup('type', {key: 'value'});
|
||||
|
||||
const asset = Asset.fromModule(1);
|
||||
asset.downloadAsync();
|
||||
Asset.loadAsync(1);
|
||||
Asset.loadAsync([1, 2, 3]);
|
||||
const asset1 = new Asset({
|
||||
uri: 'uri',
|
||||
type: 'type',
|
||||
name: 'name',
|
||||
hash: 'hash',
|
||||
width: 122,
|
||||
height: 122
|
||||
});
|
||||
|
||||
const url = AuthSession.getRedirectUrl();
|
||||
AuthSession.dismiss();
|
||||
AuthSession.startAsync({
|
||||
authUrl: 'url1',
|
||||
returnUrl: 'url2'
|
||||
}).then(result => {
|
||||
switch (result.type) {
|
||||
case 'success':
|
||||
result.event;
|
||||
result.params;
|
||||
break;
|
||||
case 'error':
|
||||
result.errorCode;
|
||||
result.params;
|
||||
result.event;
|
||||
break;
|
||||
case 'dismissed':
|
||||
case 'cancel':
|
||||
result.type;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
Audio.setAudioModeAsync({
|
||||
shouldDuckAndroid: false,
|
||||
playsInSilentModeIOS: true,
|
||||
interruptionModeIOS: 2,
|
||||
interruptionModeAndroid: 1,
|
||||
allowsRecordingIOS: true
|
||||
});
|
||||
Audio.setIsEnabledAsync(true);
|
||||
async () => {
|
||||
const result = await Audio.Sound.create('uri', {
|
||||
volume: 0.5,
|
||||
rate: 0.6
|
||||
}, null, true);
|
||||
|
||||
const sound = result.sound;
|
||||
const status = result.status;
|
||||
|
||||
if (!status.isLoaded) {
|
||||
status.error;
|
||||
} else {
|
||||
status.didJustFinish;
|
||||
// etc.
|
||||
}
|
||||
|
||||
const _status = await sound.getStatusAsync();
|
||||
await sound.loadAsync('uri');
|
||||
};
|
||||
|
||||
() => (
|
||||
<AppLoading
|
||||
startAsync={() => Promise.resolve()}
|
||||
onFinish={() => {}}
|
||||
onError={(error) => console.log(error)} />
|
||||
);
|
||||
() => (
|
||||
<AppLoading
|
||||
startAsync={null}
|
||||
onFinish={null}
|
||||
onError={null} />
|
||||
);
|
||||
|
||||
const barcodeReadCallback = () => {};
|
||||
() => (
|
||||
<BarCodeScanner
|
||||
type="front"
|
||||
torchMode="off"
|
||||
barCodeTypes={['s']}
|
||||
onBarCodeRead={barcodeReadCallback} />
|
||||
);
|
||||
|
||||
() => (
|
||||
<BlurView
|
||||
tint="dark"
|
||||
intensity={2} />
|
||||
);
|
||||
|
||||
async () => {
|
||||
await Brightness.setBrightnessAsync(.6);
|
||||
await Brightness.setSystemBrightnessAsync(.7);
|
||||
const br1 = await Brightness.getBrightnessAsync();
|
||||
const br2 = await Brightness.getSystemBrightnessAsync();
|
||||
};
|
||||
|
||||
Camera.Constants.AutoFocus;
|
||||
Camera.Constants.Type;
|
||||
Camera.Constants.FlashMode;
|
||||
Camera.Constants.WhiteBalance;
|
||||
Camera.Constants.VideoQuality;
|
||||
Camera.Constants.BarCodeType;
|
||||
() => {
|
||||
return(<Camera ref={(component: any) => {
|
||||
if (component) {
|
||||
component.recordAsync();
|
||||
}
|
||||
}} />);
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await DocumentPicker.getDocumentAsync();
|
||||
|
||||
if (result.type === 'success') {
|
||||
result.name;
|
||||
result.uri;
|
||||
result.size;
|
||||
}
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await Facebook.logInWithReadPermissionsAsync('appId');
|
||||
|
||||
if (result.type === 'success') {
|
||||
result.expires;
|
||||
result.token;
|
||||
}
|
||||
};
|
||||
|
||||
() => (
|
||||
<FacebookAds.BannerView
|
||||
type="large"
|
||||
placementId="str"
|
||||
onPress={() => {}}
|
||||
onError={() => {}} />
|
||||
);
|
||||
|
||||
async () => {
|
||||
const info = await FileSystem.getInfoAsync('file');
|
||||
|
||||
info.exists;
|
||||
info.isDirectory;
|
||||
|
||||
if (info.exists) {
|
||||
info.md5;
|
||||
info.uri;
|
||||
info.size;
|
||||
info.modificationTime;
|
||||
}
|
||||
|
||||
const string: string = await FileSystem.readAsStringAsync('file');
|
||||
await FileSystem.writeAsStringAsync('file', 'content');
|
||||
await FileSystem.deleteAsync('file');
|
||||
await FileSystem.moveAsync({ from: 'from', to: 'to'});
|
||||
await FileSystem.copyAsync({ from: 'from', to: 'to' });
|
||||
await FileSystem.makeDirectoryAsync('dir');
|
||||
const dirs: string[] = await FileSystem.readDirectoryAsync('dir');
|
||||
const result = await FileSystem.downloadAsync('from', 'to');
|
||||
|
||||
result.headers;
|
||||
result.status;
|
||||
result.uri;
|
||||
result.md5;
|
||||
};
|
||||
Vendored
+1481
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"jsx": "react",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"expo-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+1
-1
@@ -820,7 +820,7 @@ export interface Application extends IRouter, Express.Application {
|
||||
* Express instance itself is a request handler, which could be invoked without
|
||||
* third argument.
|
||||
*/
|
||||
(req: Request, res: Response): any;
|
||||
(req: Request | http.IncomingMessage, res: Response | http.ServerResponse): any;
|
||||
|
||||
/**
|
||||
* Initialize the server.
|
||||
|
||||
Vendored
+1
-1
@@ -27,7 +27,7 @@ declare namespace gapi.auth2 {
|
||||
* Signs in the user using the specified options.
|
||||
* If no option specified here, fallback to the options specified to gapi.auth2.init().
|
||||
*/
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): any;
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): Promise<GoogleUser>;
|
||||
|
||||
/**
|
||||
* Signs out all accounts from the application.
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
import {
|
||||
BBox,
|
||||
Feature, FeatureCollection, GeometryCollection, LineString,
|
||||
MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeometryObject
|
||||
} from "geojson";
|
||||
|
||||
let featureCollection: FeatureCollection<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon | GeometryCollection> = {
|
||||
type: "FeatureCollection",
|
||||
features: [
|
||||
{
|
||||
@@ -34,7 +40,7 @@ let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]
|
||||
]
|
||||
},
|
||||
properties: {
|
||||
@@ -44,17 +50,10 @@ let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
crs: {
|
||||
type: "link",
|
||||
properties: {
|
||||
href: "http://example.com/crs/42",
|
||||
type: "proj4"
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
let featureWithPolygon: GeoJSON.Feature<GeoJSON.Polygon> = {
|
||||
const featureWithPolygon: Feature<Polygon> = {
|
||||
type: "Feature",
|
||||
bbox: [-180.0, -90.0, 180.0, 90.0],
|
||||
geometry: {
|
||||
@@ -66,57 +65,57 @@ let featureWithPolygon: GeoJSON.Feature<GeoJSON.Polygon> = {
|
||||
properties: null
|
||||
};
|
||||
|
||||
let point: GeoJSON.Point = {
|
||||
const point: Point = {
|
||||
type: "Point",
|
||||
coordinates: [100.0, 0.0]
|
||||
};
|
||||
|
||||
// This type is commonly used in the turf package
|
||||
let pointCoordinates: number[] = point.coordinates;
|
||||
const pointCoordinates: number[] = point.coordinates;
|
||||
|
||||
let lineString: GeoJSON.LineString = {
|
||||
const lineString: LineString = {
|
||||
type: "LineString",
|
||||
coordinates: [ [100.0, 0.0], [101.0, 1.0] ]
|
||||
coordinates: [[100.0, 0.0], [101.0, 1.0]]
|
||||
};
|
||||
|
||||
let polygon: GeoJSON.Polygon = {
|
||||
const polygon: Polygon = {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]
|
||||
]
|
||||
};
|
||||
|
||||
let polygonWithHole: GeoJSON.Polygon = {
|
||||
const polygonWithHole: Polygon = {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
|
||||
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]
|
||||
]
|
||||
};
|
||||
|
||||
let multiPoint: GeoJSON.MultiPoint = {
|
||||
const multiPoint: MultiPoint = {
|
||||
type: "MultiPoint",
|
||||
coordinates: [ [100.0, 0.0], [101.0, 1.0] ]
|
||||
coordinates: [[100.0, 0.0], [101.0, 1.0]]
|
||||
};
|
||||
|
||||
let multiLineString: GeoJSON.MultiLineString = {
|
||||
const multiLineString: MultiLineString = {
|
||||
type: "MultiLineString",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 1.0] ],
|
||||
[ [102.0, 2.0], [103.0, 3.0] ]
|
||||
[[100.0, 0.0], [101.0, 1.0]],
|
||||
[[102.0, 2.0], [103.0, 3.0]]
|
||||
]
|
||||
};
|
||||
|
||||
let multiPolygon: GeoJSON.MultiPolygon = {
|
||||
const multiPolygon: MultiPolygon = {
|
||||
type: "MultiPolygon",
|
||||
coordinates: [
|
||||
[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],
|
||||
[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
|
||||
]
|
||||
};
|
||||
|
||||
let geometryCollection: GeoJSON.GeometryCollection = {
|
||||
const geometryCollection: GeometryCollection = {
|
||||
type: "GeometryCollection",
|
||||
geometries: [
|
||||
{
|
||||
@@ -125,16 +124,17 @@ let geometryCollection: GeoJSON.GeometryCollection = {
|
||||
},
|
||||
{
|
||||
type: "LineString",
|
||||
coordinates: [ [101.0, 0.0], [102.0, 1.0] ]
|
||||
coordinates: [[101.0, 0.0], [102.0, 1.0]]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
let feature: GeoJSON.Feature<GeoJSON.GeometryObject> = {
|
||||
let feature: Feature<GeometryObject> = {
|
||||
type: "Feature",
|
||||
geometry: lineString,
|
||||
properties: null
|
||||
};
|
||||
|
||||
feature = {
|
||||
type: "Feature",
|
||||
geometry: polygon,
|
||||
@@ -172,44 +172,37 @@ featureCollection = {
|
||||
{
|
||||
type: "Feature",
|
||||
geometry: lineString,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: polygon,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: polygonWithHole,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiPoint,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiLineString,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiPolygon,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: geometryCollection,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}
|
||||
],
|
||||
crs: {
|
||||
type: "link",
|
||||
properties: {
|
||||
href: "http://example.com/crs/42",
|
||||
type: "proj4"
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// Allow access to custom properties
|
||||
const pt: GeoJSON.Feature<GeoJSON.Point> = {
|
||||
const pt: Feature<Point> = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
foo: "bar",
|
||||
@@ -221,9 +214,14 @@ const pt: GeoJSON.Feature<GeoJSON.Point> = {
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
};
|
||||
pt.properties.foo;
|
||||
pt.properties.hello;
|
||||
pt.properties[1];
|
||||
|
||||
if (pt.properties) {
|
||||
if (pt.properties.foo == null || pt.properties.hello == null || pt.properties[1] == null) {
|
||||
throw TypeError("Properties should not be null or undefined.");
|
||||
}
|
||||
} else {
|
||||
throw TypeError("Feature should have a 'properties' property.");
|
||||
}
|
||||
|
||||
// Optional generic for properties
|
||||
|
||||
@@ -232,19 +230,21 @@ interface TestProperty {
|
||||
hello: string;
|
||||
}
|
||||
|
||||
const typedPropertiesFeature: GeoJSON.Feature<GeoJSON.Point, TestProperty> = {
|
||||
const testProps: TestProperty = {
|
||||
foo: "bar",
|
||||
hello: "world"
|
||||
};
|
||||
|
||||
const typedPropertiesFeature: Feature<Point> = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
foo: "bar",
|
||||
hello: "world",
|
||||
},
|
||||
properties: testProps,
|
||||
geometry: {
|
||||
type: "Point",
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
};
|
||||
|
||||
const typedPropertiesFeatureCollection: GeoJSON.FeatureCollection<GeoJSON.Point, TestProperty> = {
|
||||
const typedPropertiesFeatureCollection: FeatureCollection<Point> = {
|
||||
type: "FeatureCollection",
|
||||
features: [typedPropertiesFeature]
|
||||
};
|
||||
|
||||
Vendored
+108
-66
@@ -1,123 +1,165 @@
|
||||
// Type definitions for GeoJSON Format Specification Revision 1.0
|
||||
// Project: http://geojson.org/
|
||||
// Type definitions for geojson 7946.0
|
||||
// Project: https://geojson.org/
|
||||
// Definitions by: Jacob Bruun <https://github.com/cobster>
|
||||
// Arne Schubert <https://github.com/atd-schubert>
|
||||
// Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
|
||||
// are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
|
||||
|
||||
export as namespace GeoJSON;
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geojson-objects
|
||||
/**
|
||||
* The valid values for the "type" property of GeoJSON geometry objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonGeometryTypes = "Point" | "LineString" | "MultiPoint" | "Polygon" | "MultiLineString" |
|
||||
"MultiPolygon" | "GeometryCollection";
|
||||
|
||||
/**
|
||||
* The value values for the "type" property of GeoJSON Objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonTypes = "FeatureCollection" | "Feature" | GeoJsonGeometryTypes;
|
||||
|
||||
/**
|
||||
* Bounding box
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
export type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
||||
|
||||
/**
|
||||
* A Position is an array of coordinates.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
||||
* Array should contain between two and three elements.
|
||||
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
||||
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
||||
*/
|
||||
export type Position = number[]; // [number, number] | [number, number, number];
|
||||
|
||||
/**
|
||||
* The base GeoJSON object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
* The GeoJSON specification also allows foreign members
|
||||
* (https://tools.ietf.org/html/rfc7946#section-6.1)
|
||||
* Developers should use "&" type in TypeScript or extend the interface
|
||||
* to add these foreign members.
|
||||
*/
|
||||
export interface GeoJsonObject {
|
||||
type: string;
|
||||
bbox?: number[];
|
||||
crs?: CoordinateReferenceSystem;
|
||||
// Don't include foreign members directly into this type def.
|
||||
// in order to preserve type safety.
|
||||
// [key: string]: any;
|
||||
/**
|
||||
* Specifies the type of GeoJSON object.
|
||||
*/
|
||||
type: GeoJsonTypes;
|
||||
/**
|
||||
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
bbox?: BBox;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#positions
|
||||
*/
|
||||
export type Position = number[];
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geometry-objects
|
||||
*/
|
||||
export interface DirectGeometryObject extends GeoJsonObject {
|
||||
coordinates: Position[][][] | Position[][] | Position[] | Position;
|
||||
}
|
||||
/**
|
||||
* GeometryObject supports geometry collection as well
|
||||
* A geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export type GeometryObject = DirectGeometryObject | GeometryCollection;
|
||||
export interface GeometryObject extends GeoJsonObject {
|
||||
type: GeoJsonGeometryTypes;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#point
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export interface Point extends DirectGeometryObject {
|
||||
export interface Point extends GeometryObject {
|
||||
type: "Point";
|
||||
coordinates: Position;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multipoint
|
||||
/**
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export interface MultiPoint extends DirectGeometryObject {
|
||||
export interface MultiPoint extends GeometryObject {
|
||||
type: "MultiPoint";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#linestring
|
||||
/**
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export interface LineString extends DirectGeometryObject {
|
||||
export interface LineString extends GeometryObject {
|
||||
type: "LineString";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multilinestring
|
||||
/**
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export interface MultiLineString extends DirectGeometryObject {
|
||||
export interface MultiLineString extends GeometryObject {
|
||||
type: "MultiLineString";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#polygon
|
||||
/**
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export interface Polygon extends DirectGeometryObject {
|
||||
export interface Polygon extends GeometryObject {
|
||||
type: "Polygon";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multipolygon
|
||||
/**
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export interface MultiPolygon extends DirectGeometryObject {
|
||||
export interface MultiPolygon extends GeometryObject {
|
||||
type: "MultiPolygon";
|
||||
coordinates: Position[][][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geometry-collection
|
||||
/**
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export interface GeometryCollection extends GeoJsonObject {
|
||||
export interface GeometryCollection extends GeometryObject {
|
||||
type: "GeometryCollection";
|
||||
geometries: GeometryObject[];
|
||||
geometries: Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>;
|
||||
}
|
||||
|
||||
/***
|
||||
export type GeoJsonProperties = { [name: string]: any; } | null;
|
||||
|
||||
/**
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
*/
|
||||
export interface Feature<G extends GeometryObject, P = any> extends GeoJsonObject {
|
||||
export interface Feature<G extends GeometryObject, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "Feature";
|
||||
geometry: G;
|
||||
properties: P;
|
||||
/**
|
||||
* The feature's geometry
|
||||
*/
|
||||
geometry: G | null;
|
||||
/**
|
||||
* A value that uniquely identifies this feature in a
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
||||
*/
|
||||
id?: string | number;
|
||||
/**
|
||||
* Properties associated with this feature.
|
||||
*/
|
||||
properties: P | null;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#feature-collection-objects
|
||||
/**
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
*/
|
||||
export interface FeatureCollection<G extends GeometryObject, P = any> extends GeoJsonObject {
|
||||
type: "FeatureCollection";
|
||||
export interface FeatureCollection<G extends GeometryObject, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
features: Array<Feature<G, P>>;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
|
||||
*/
|
||||
export interface CoordinateReferenceSystem {
|
||||
type: string;
|
||||
properties: any;
|
||||
}
|
||||
|
||||
export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem {
|
||||
properties: { name: string };
|
||||
}
|
||||
|
||||
export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem {
|
||||
properties: { href: string; type: string };
|
||||
}
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import fs = require('fs');
|
||||
import gzipSize = require('gzip-size');
|
||||
|
||||
const string = 'Lorem ipsum dolor sit amet.';
|
||||
|
||||
console.log(string.length);
|
||||
|
||||
gzipSize(string).then(size => console.log(size));
|
||||
|
||||
console.log(gzipSize.sync(string));
|
||||
|
||||
const stream = fs.createReadStream("index.d.ts");
|
||||
const gstream = stream.pipe(gzipSize.stream()).on("gzip-size", size => console.log(size));
|
||||
console.log(gstream.gzipSize); // Could be a number or undefined. Recommended to use "gzip-size" event instead
|
||||
|
||||
gzipSize.file("index.d.ts").then(size => console.log(size));
|
||||
|
||||
Vendored
+37
-2
@@ -1,7 +1,8 @@
|
||||
// Type definitions for gzip-size 4.0
|
||||
// Type definitions for gzip-size 4.1
|
||||
// Project: https://github.com/sindresorhus/gzip-size
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Jimi van der Woning <https://github.com/jimivdw>
|
||||
// Andre Wiggins <https://github.com/andrewiggins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -9,11 +10,45 @@
|
||||
import * as stream from 'stream';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
interface GzipSizeStream extends stream.PassThrough {
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "gzip-size", listener: (size: number) => void): this;
|
||||
|
||||
/**
|
||||
* Contains the gzip size of the stream after it is finished.
|
||||
* Since this happens asynchronously, it is recommended you use
|
||||
* the `.on("gzip-size", size => console.log(size))` method instead
|
||||
*/
|
||||
gzipSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Promise for the size.
|
||||
* @param input A string or Buffer to determine the gzip size of
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
declare function gzipSize(input: string | Buffer, options?: zlib.ZlibOptions): Promise<number>;
|
||||
|
||||
declare namespace gzipSize {
|
||||
/**
|
||||
* Returns the size synchronously
|
||||
* @param input A string or Buffer to determine the gzip size of
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function sync(input: string | Buffer, options?: zlib.ZlibOptions): number;
|
||||
function stream(options?: zlib.ZlibOptions): stream.PassThrough;
|
||||
|
||||
/**
|
||||
* Returns a stream.PassThrough. The stream emits a gzip-size event and has a gzipSize property.
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function stream(options?: zlib.ZlibOptions): GzipSizeStream;
|
||||
|
||||
/**
|
||||
* Returns a Promise for the size of the file.
|
||||
* @param path The path to the file
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function file(path: string, options?: zlib.ZlibOptions): Promise<number>;
|
||||
}
|
||||
|
||||
export = gzipSize;
|
||||
|
||||
Vendored
+5
-1
@@ -1,10 +1,14 @@
|
||||
// Type definitions for highlight.js v9.12
|
||||
// Project: https://github.com/isagalaev/highlight.js
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>, Jeremy Hull <https://github.com/sourrust>
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Jeremy Hull <https://github.com/sourrust>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace hljs
|
||||
{
|
||||
interface Node { }
|
||||
|
||||
export function highlight(
|
||||
name: string,
|
||||
value: string,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/TheDeveloper/http-aws-es#readme
|
||||
// Definitions by: Marco Gonzalez <https://github.com/marcogrcr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import Agent = require('http-proxy-agent');
|
||||
|
||||
// $ExpectType HttpProxyAgent
|
||||
new Agent('url');
|
||||
new Agent({});
|
||||
new Agent({ host: 'url' });
|
||||
|
||||
// $ExpectError
|
||||
new Agent();
|
||||
|
||||
// $ExpectError
|
||||
new Agent({ a: 1 });
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for http-proxy-agent 2.0
|
||||
// Project: https://github.com/TooTallNate/node-http-proxy-agent
|
||||
// Definitions by: mrmlnc <https://github.com/mrmlnc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import { Agent } from 'http';
|
||||
import { Url } from 'url';
|
||||
|
||||
declare class HttpProxyAgent extends Agent {
|
||||
constructor(options: string | Url);
|
||||
}
|
||||
|
||||
export = HttpProxyAgent;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"http-proxy-agent-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Test suite created by Yuya Tanaka <https://github.com/ypresto>
|
||||
* Created by using code examples from https://github.com/fnando/i18n-js
|
||||
*/
|
||||
|
||||
import I18n = require("i18n-js");
|
||||
|
||||
I18n.defaultLocale = "pt-BR";
|
||||
I18n.locale = "pt-BR";
|
||||
I18n.currentLocale() === "pt-BR";
|
||||
|
||||
I18n.t("some.scoped.translation");
|
||||
I18n.t("some.scoped.translation", { locale: "fr" });
|
||||
I18n.t("hello", { name: "John Doe" });
|
||||
I18n.t("some.missing.scope", { defaultValue: "A default message" });
|
||||
I18n.t("noun", { defaultValue: "I'm a {{noun}}", noun: "Mac" });
|
||||
I18n.t("some.missing.scope", { defaults: [{ scope: "some.existing.scope" }] });
|
||||
I18n.t("some.missing.scope", { defaults: [{ message: "Some message" }] });
|
||||
|
||||
I18n.fallbacks = true;
|
||||
I18n.locales.no = ["nb", "en"];
|
||||
I18n.locales.no = "nb";
|
||||
I18n.locales.no = locale => ["nb"];
|
||||
|
||||
I18n.missingBehaviour = "guess";
|
||||
I18n.missingTranslationPrefix = "EE: ";
|
||||
I18n.missingTranslation = (scope, options) => "foobar";
|
||||
I18n.missingTranslation = (scope, options) => null;
|
||||
I18n.missingTranslation = (scope, options) => undefined;
|
||||
|
||||
I18n.t("inbox.counting", { count: 10 });
|
||||
I18n.pluralization["ru"] = count => {
|
||||
const key = count % 10 === 1 && count % 100 !== 11 ? "one"
|
||||
: [2, 3, 4].indexOf(count % 10) >= 0 && [12, 13, 14].indexOf(count % 100) < 0 ? "few"
|
||||
: count % 10 === 0 || [5, 6, 7, 8, 9].indexOf(count % 10) >= 0 || [11, 12, 13, 14].indexOf(count % 100) >= 0 ? "many"
|
||||
: "other";
|
||||
return [key];
|
||||
};
|
||||
|
||||
const options = { scope: "activerecord.attributes.user" };
|
||||
I18n.t("name", options);
|
||||
I18n.t(["greetings", "hello"]);
|
||||
|
||||
I18n.l("currency", 1990.99);
|
||||
I18n.l("number", 1990.99);
|
||||
I18n.l("percentage", 123.45);
|
||||
|
||||
I18n.toNumber(1000);
|
||||
I18n.toCurrency(1000);
|
||||
I18n.toPercentage(100);
|
||||
|
||||
I18n.toNumber(1000, { precision: 0 });
|
||||
I18n.toNumber(1000, { delimiter: ".", separator: "," });
|
||||
I18n.toNumber(1000, { delimiter: ".", precision: 0 });
|
||||
|
||||
I18n.toCurrency(1000, { precision: 0 });
|
||||
|
||||
I18n.toHumanSize(1234);
|
||||
|
||||
I18n.l("date.formats.short", "2009-09-18");
|
||||
I18n.l("time.formats.short", "2009-09-18 23:12:43");
|
||||
I18n.l("time.formats.short", "2009-11-09T18:10:34");
|
||||
I18n.l("time.formats.short", "2009-11-09T18:10:34Z");
|
||||
I18n.l("date.formats.short", 1251862029000);
|
||||
I18n.l("date.formats.short", "09/18/2009");
|
||||
I18n.l("date.formats.short", (new Date()));
|
||||
|
||||
I18n.l("date.formats.ordinal_day", "2009-09-18", { day: "18th" });
|
||||
|
||||
I18n.strftime(new Date(), "%d/%m/%Y");
|
||||
|
||||
const point_in_number = 1000;
|
||||
I18n.t("point", { count: point_in_number, formatted_number: I18n.toNumber(point_in_number) });
|
||||
|
||||
I18n.translations = {};
|
||||
I18n.translations["en"] = {
|
||||
message: "Some special message for you"
|
||||
};
|
||||
I18n.translations["pt-BR"] = {
|
||||
message: "Uma mensagem especial para você"
|
||||
};
|
||||
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
// Type definitions for i18n-js 3.0
|
||||
// Project: https://github.com/fnando/i18n-js
|
||||
// Definitions by: Yuya Tanaka <https://github.com/ypresto>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
// tslint:disable-next-line:export-just-namespace
|
||||
export = I18n;
|
||||
export as namespace I18n;
|
||||
|
||||
declare namespace I18n {
|
||||
type Scope = string | string[];
|
||||
|
||||
let defaultLocale: string;
|
||||
let locale: string;
|
||||
let defaultSeparator: string;
|
||||
let placeholder: RegExp;
|
||||
let fallbacks: boolean;
|
||||
let missingBehaviour: "message" | "guess";
|
||||
let missingTranslationPrefix: string;
|
||||
|
||||
// tslint:disable-next-line prefer-declare-function
|
||||
let missingTranslation: (scope: string, options?: TranslateOptions) => string | null | undefined;
|
||||
// tslint:disable-next-line prefer-declare-function
|
||||
let missingPlaceholder: (placeholder: string, message: string, options?: InterpolateOptions) => string | null | undefined;
|
||||
// tslint:disable-next-line prefer-declare-function
|
||||
let nullPlaceholder: (placeholder: string, message: string, options?: InterpolateOptions) => string | null | undefined;
|
||||
|
||||
let translations: { [locale: string]: object };
|
||||
let locales: { [key: string]: string | string[] | ((locale: string) => string | string[]) };
|
||||
let pluralization: { [locale: string]: (count: number) => string[] };
|
||||
|
||||
function reset(): void;
|
||||
|
||||
function currentLocale(): string;
|
||||
|
||||
interface InterpolateOptions {
|
||||
[key: string]: any; // interpolation
|
||||
}
|
||||
|
||||
interface TranslateOptions extends InterpolateOptions {
|
||||
scope?: Scope;
|
||||
message?: string;
|
||||
defaults?: Array<{ message: string } | { scope: Scope }>;
|
||||
defaultValue?: string;
|
||||
}
|
||||
function translate(scope: Scope, options?: TranslateOptions): string;
|
||||
function t(scope: Scope, options?: TranslateOptions): string;
|
||||
|
||||
function localize(scope: "currency" | "number" | "percentage", value: number, options?: InterpolateOptions): string;
|
||||
function localize(scope: Scope, value: string | number | Date, options?: InterpolateOptions): string;
|
||||
function l(scope: "currency" | "number" | "percentage", value: number, options?: InterpolateOptions): string;
|
||||
function l(scope: Scope, value: string | number | Date, options?: InterpolateOptions): string;
|
||||
|
||||
interface ToNumberOptions {
|
||||
precision?: number;
|
||||
separator?: string;
|
||||
delimiter?: string;
|
||||
strip_insignificant_zeros?: boolean;
|
||||
}
|
||||
function toNumber(num: number, options?: ToNumberOptions): string;
|
||||
|
||||
type ToPercentageOptions = ToNumberOptions;
|
||||
function toPercentage(num: number, options?: ToPercentageOptions): string;
|
||||
|
||||
interface ToCurrencyOptions extends ToNumberOptions {
|
||||
format?: string;
|
||||
unit?: string;
|
||||
sign_first?: boolean;
|
||||
}
|
||||
function toCurrency(num: number, options?: ToCurrencyOptions): string;
|
||||
|
||||
interface ToHumanSizeOptions extends ToNumberOptions {
|
||||
format?: string;
|
||||
}
|
||||
function toHumanSize(num: number, options?: ToHumanSizeOptions): string;
|
||||
|
||||
function strftime(date: Date, format: string): string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"i18n-js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"indent": [true, "spaces", 4],
|
||||
"quotemark": [true, "double", "avoid-escape"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { createReadStream, createWriteStream } from 'fs';
|
||||
import * as br from 'iltorb';
|
||||
|
||||
const opts: br.BrotliEncodeParams = {
|
||||
disable_literal_context_modeling: false,
|
||||
lgblock: 0,
|
||||
lgwin: 22,
|
||||
mode: 0,
|
||||
quality: 11,
|
||||
size_hint: 0
|
||||
};
|
||||
|
||||
const onCompress = (err1: Error | null | undefined, compressed: Buffer) => {
|
||||
br.decompress(compressed, (err2: Error | null | undefined, decompressed: Buffer) => {
|
||||
console.log(decompressed.toString());
|
||||
});
|
||||
};
|
||||
|
||||
br.compress(Buffer.from('foo', 'utf8'), onCompress);
|
||||
|
||||
br.compress(Buffer.from('foo', 'utf8'), opts, onCompress);
|
||||
|
||||
createReadStream(__filename)
|
||||
.pipe(br.compressStream())
|
||||
.pipe(createWriteStream('foo.ts'));
|
||||
|
||||
createReadStream(__dirname)
|
||||
.pipe(br.compressStream(opts))
|
||||
.pipe(createWriteStream('bar.ts'));
|
||||
|
||||
createReadStream('bar.ts')
|
||||
.pipe(br.decompressStream())
|
||||
.pipe(createWriteStream('qux.ts'));
|
||||
|
||||
br.decompressSync(br.compressSync(Buffer.from('foo', 'utf8')));
|
||||
br.decompressSync(br.compressSync(Buffer.from('foo', 'utf8'), opts));
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for iltorb 2.0
|
||||
// Project: https://github.com/MayhemYDG/iltorb
|
||||
// Definitions by: Arturas Molcanovas <https://github.com/Alorel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import { Transform } from 'stream';
|
||||
|
||||
export interface BrotliEncodeParams {
|
||||
disable_literal_context_modeling?: boolean;
|
||||
lgblock?: number;
|
||||
lgwin?: number;
|
||||
mode?: number;
|
||||
quality?: number;
|
||||
size_hint?: number;
|
||||
}
|
||||
|
||||
export type IltorbCallback = (err: Error | null | undefined, output: Buffer) => void;
|
||||
|
||||
export function compress(buffer: Buffer, options: BrotliEncodeParams, callback: IltorbCallback): void;
|
||||
export function compress(buffer: Buffer, callback: IltorbCallback): void;
|
||||
|
||||
export function decompress(buffer: Buffer, callback: IltorbCallback): void;
|
||||
|
||||
export function compressSync(buffer: Buffer, options?: BrotliEncodeParams): Buffer;
|
||||
export function decompressSync(buffer: Buffer): Buffer;
|
||||
|
||||
export function compressStream(options?: BrotliEncodeParams): Transform;
|
||||
export function decompressStream(): Transform;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"iltorb-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+10
-3
@@ -145,10 +145,16 @@ declare namespace jest {
|
||||
*/
|
||||
function runOnlyPendingTimers(): typeof jest;
|
||||
/**
|
||||
* Executes only the macro task queue (i.e. all tasks queued by setTimeout()
|
||||
* or setInterval() and setImmediate()).
|
||||
* (renamed to `advanceTimersByTime` in Jest 21.3.0+) Executes only the macro
|
||||
* task queue (i.e. all tasks queued by setTimeout() or setInterval() and setImmediate()).
|
||||
*/
|
||||
function runTimersToTime(msToRun: number): typeof jest;
|
||||
/**
|
||||
* Advances all timers by msToRun milliseconds. All pending "macro-tasks" that have been
|
||||
* queued via setTimeout() or setInterval(), and would be executed within this timeframe
|
||||
* will be executed.
|
||||
*/
|
||||
function advanceTimersByTime(msToRun: number): typeof jest;
|
||||
/**
|
||||
* Explicitly supplies the mock object that the module system should return
|
||||
* for the specified module.
|
||||
@@ -555,7 +561,7 @@ declare namespace jasmine {
|
||||
function anything(): Any;
|
||||
function arrayContaining(sample: any[]): ArrayContaining;
|
||||
function objectContaining(sample: any): ObjectContaining;
|
||||
function createSpy(name: string, originalFn?: (...args: any[]) => any): Spy;
|
||||
function createSpy(name?: string, originalFn?: (...args: any[]) => any): Spy;
|
||||
function createSpyObj(baseName: string, methodNames: any[]): any;
|
||||
function createSpyObj<T>(baseName: string, methodNames: any[]): T;
|
||||
function pp(value: any): string;
|
||||
@@ -867,6 +873,7 @@ declare namespace jest {
|
||||
runAllTicks(): void;
|
||||
runAllTimers(): void;
|
||||
runTimersToTime(msToRun: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
runWithRealTimers(callback: any): void;
|
||||
useFakeTimers(): void;
|
||||
|
||||
Vendored
+96
-89
@@ -1,96 +1,103 @@
|
||||
// Type definitions for js-yaml 3.10.0
|
||||
// Type definitions for js-yaml 3.10
|
||||
// Project: https://github.com/nodeca/js-yaml
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Sebastian Clausen <https://github.com/sclausen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace jsyaml {
|
||||
export function safeLoad(str: string, opts?: LoadOptions): any;
|
||||
export function load(str: string, opts?: LoadOptions): any;
|
||||
export function safeLoad(str: string, opts?: LoadOptions): any;
|
||||
export function load(str: string, opts?: LoadOptions): any;
|
||||
|
||||
export interface Type extends TypeConstructorOptions { }
|
||||
export class Type {
|
||||
constructor(tag: string, opts?: TypeConstructorOptions);
|
||||
tag: string;
|
||||
}
|
||||
export class Schema {
|
||||
constructor(definition: SchemaDefinition);
|
||||
public static create(types: Type[] | Type): Schema;
|
||||
public static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
|
||||
}
|
||||
|
||||
export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any;
|
||||
export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any;
|
||||
|
||||
export function safeDump(obj: any, opts?: DumpOptions): string;
|
||||
export function dump(obj: any, opts?: DumpOptions): string;
|
||||
|
||||
export interface LoadOptions {
|
||||
// string to be used as a file path in error/warning messages.
|
||||
filename?: string;
|
||||
// makes the loader to throw errors instead of warnings.
|
||||
strict?: boolean;
|
||||
// specifies a schema to use.
|
||||
schema?: any;
|
||||
}
|
||||
|
||||
export interface DumpOptions {
|
||||
// indentation width to use (in spaces).
|
||||
indent?: number;
|
||||
// do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types.
|
||||
skipInvalid?: boolean;
|
||||
// specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere
|
||||
flowLevel?: number;
|
||||
// Each tag may have own set of styles. - "tag" => "style" map.
|
||||
styles?: Object;
|
||||
// specifies a schema to use.
|
||||
schema?: any;
|
||||
// if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false)
|
||||
sortKeys?: boolean | ((a: any, b: any) => number);
|
||||
// set max line width. (default: 80)
|
||||
lineWidth?: number;
|
||||
// if true, don't convert duplicate objects into references (default: false)
|
||||
noRefs?: boolean;
|
||||
// if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false)
|
||||
noCompatMode?: boolean;
|
||||
// if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false)
|
||||
condenseFlow?: boolean;
|
||||
}
|
||||
|
||||
export interface TypeConstructorOptions {
|
||||
kind?: string;
|
||||
resolve?: Function;
|
||||
construct?: Function;
|
||||
instanceOf?: Object;
|
||||
predicate?: string;
|
||||
represent?: Function;
|
||||
defaultStyle?: string;
|
||||
styleAliases?: Object;
|
||||
}
|
||||
|
||||
export interface SchemaDefinition {
|
||||
implicit?: any[];
|
||||
explicit?: any[];
|
||||
include?: any[];
|
||||
}
|
||||
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
export var FAILSAFE_SCHEMA: any;
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
export var JSON_SCHEMA: any;
|
||||
// same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923
|
||||
export var CORE_SCHEMA: any;
|
||||
// all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/
|
||||
export var DEFAULT_SAFE_SCHEMA: any;
|
||||
// all supported YAML types.
|
||||
export var DEFAULT_FULL_SCHEMA: any;
|
||||
export var MINIMAL_SCHEMA: any;
|
||||
export var SAFE_SCHEMA: any;
|
||||
|
||||
export class YAMLException extends Error {
|
||||
constructor(reason?: any, mark?: any);
|
||||
toString(compact?: boolean): string;
|
||||
}
|
||||
export class Type {
|
||||
constructor(tag: string, opts?: TypeConstructorOptions);
|
||||
kind: 'sequence' | 'scalar' | 'mapping' | null;
|
||||
resolve(data: any): boolean;
|
||||
construct(data: any): any;
|
||||
instanceOf: object | null;
|
||||
predicate: string | null;
|
||||
represent: ((data: object) => any) | { [x: string]: (data: object) => any; } | null;
|
||||
defaultStyle: string | null;
|
||||
styleAliases: { [x: string]: any; };
|
||||
}
|
||||
|
||||
export = jsyaml;
|
||||
export as namespace jsyaml;
|
||||
/* tslint:disable-next-line:no-unnecessary-class */
|
||||
export class Schema implements SchemaDefinition {
|
||||
constructor(definition: SchemaDefinition);
|
||||
static create(types: Type[] | Type): Schema;
|
||||
static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
|
||||
}
|
||||
|
||||
export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any;
|
||||
export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any;
|
||||
|
||||
export function safeDump(obj: any, opts?: DumpOptions): string;
|
||||
export function dump(obj: any, opts?: DumpOptions): string;
|
||||
|
||||
export interface LoadOptions {
|
||||
// string to be used as a file path in error/warning messages.
|
||||
filename?: string;
|
||||
// makes the loader to throw errors instead of warnings.
|
||||
strict?: boolean;
|
||||
// specifies a schema to use.
|
||||
schema?: any;
|
||||
// compatibility with JSON.parse behaviour.
|
||||
json?: boolean;
|
||||
}
|
||||
|
||||
export interface DumpOptions {
|
||||
// indentation width to use (in spaces).
|
||||
indent?: number;
|
||||
// do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types.
|
||||
skipInvalid?: boolean;
|
||||
// specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere
|
||||
flowLevel?: number;
|
||||
// Each tag may have own set of styles. - "tag" => "style" map.
|
||||
styles?: { [x: string]: any; };
|
||||
// specifies a schema to use.
|
||||
schema?: any;
|
||||
// if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false)
|
||||
sortKeys?: boolean | ((a: any, b: any) => number);
|
||||
// set max line width. (default: 80)
|
||||
lineWidth?: number;
|
||||
// if true, don't convert duplicate objects into references (default: false)
|
||||
noRefs?: boolean;
|
||||
// if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false)
|
||||
noCompatMode?: boolean;
|
||||
// if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
|
||||
// Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false)
|
||||
condenseFlow?: boolean;
|
||||
}
|
||||
|
||||
export interface TypeConstructorOptions {
|
||||
kind?: 'sequence' | 'scalar' | 'mapping';
|
||||
resolve?: (data: any) => boolean;
|
||||
construct?: (data: any) => any;
|
||||
instanceOf?: object;
|
||||
predicate?: string;
|
||||
represent?: ((data: object) => any) | { [x: string]: (data: object) => any };
|
||||
defaultStyle?: string;
|
||||
styleAliases?: { [x: string]: any; };
|
||||
}
|
||||
|
||||
export interface SchemaDefinition {
|
||||
implicit?: any[];
|
||||
explicit?: Type[];
|
||||
include?: Schema[];
|
||||
}
|
||||
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
export let FAILSAFE_SCHEMA: Schema;
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
export let JSON_SCHEMA: Schema;
|
||||
// same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923
|
||||
export let CORE_SCHEMA: Schema;
|
||||
// all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/
|
||||
export let DEFAULT_SAFE_SCHEMA: Schema;
|
||||
// all supported YAML types.
|
||||
export let DEFAULT_FULL_SCHEMA: Schema;
|
||||
export let MINIMAL_SCHEMA: Schema;
|
||||
export let SAFE_SCHEMA: Schema;
|
||||
|
||||
export class YAMLException extends Error {
|
||||
constructor(reason?: any, mark?: any);
|
||||
toString(compact?: boolean): string;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user