mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into jquery
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import * as Alexa from "alexa-sdk";
|
||||
|
||||
const handler = (event: Alexa.RequestBody, context: Alexa.Context, callback: () => void) => {
|
||||
const handler = (event: Alexa.RequestBody<Alexa.Request>, context: Alexa.Context, callback: () => void) => {
|
||||
let alexa = Alexa.handler(event, context);
|
||||
alexa.registerHandlers(handlers);
|
||||
alexa.execute();
|
||||
};
|
||||
|
||||
let handlers: Alexa.Handlers = {
|
||||
let handlers: Alexa.Handlers<Alexa.Request> = {
|
||||
'LaunchRequest': function() {
|
||||
this.emit('SayHello');
|
||||
},
|
||||
|
||||
55
types/alexa-sdk/index.d.ts
vendored
55
types/alexa-sdk/index.d.ts
vendored
@@ -6,14 +6,14 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void ): AlexaObject;
|
||||
export function handler<T>(event: RequestBody<T>, context: Context, callback?: (err: any, response: any) => void ): AlexaObject<T>;
|
||||
export function CreateStateHandler(state: string, obj: any): any;
|
||||
export let StateString: string;
|
||||
|
||||
export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED";
|
||||
export type DialogStates = "STARTED" | "IN_PROGRESS" | "COMPLETED";
|
||||
|
||||
export interface AlexaObject extends Handler {
|
||||
export interface AlexaObject<T> extends Handler<T> {
|
||||
_event: any;
|
||||
_context: any;
|
||||
_callback: any;
|
||||
@@ -22,26 +22,26 @@ export interface AlexaObject extends Handler {
|
||||
response: any;
|
||||
dynamoDBTableName: any;
|
||||
saveBeforeResponse: boolean;
|
||||
registerHandlers: (...handlers: Handlers[]) => any;
|
||||
registerHandlers: (...handlers: Array<Handlers<T>>) => any;
|
||||
execute: () => void;
|
||||
}
|
||||
|
||||
export interface Handlers {
|
||||
[intent: string]: (this: Handler) => void;
|
||||
export interface Handlers<T> {
|
||||
[intent: string]: (this: Handler<T>) => void;
|
||||
}
|
||||
|
||||
export interface Handler {
|
||||
export interface Handler<T> {
|
||||
on: any;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emitWithState: any;
|
||||
state: any;
|
||||
handler: any;
|
||||
event: RequestBody;
|
||||
event: RequestBody<T>;
|
||||
attributes: any;
|
||||
context: any;
|
||||
name: any;
|
||||
isOverriden: any;
|
||||
t: (token: string) => void;
|
||||
t: (token: string, ...args: any[]) => void;
|
||||
}
|
||||
|
||||
export interface Context {
|
||||
@@ -55,10 +55,10 @@ export interface Context {
|
||||
awsRequestId: string;
|
||||
}
|
||||
|
||||
export interface RequestBody {
|
||||
export interface RequestBody<T> {
|
||||
version: string;
|
||||
session: Session;
|
||||
request: LaunchRequest | IntentRequest | SessionEndedRequest;
|
||||
request: T;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
@@ -75,36 +75,37 @@ export interface SessionApplication {
|
||||
|
||||
export interface SessionUser {
|
||||
userId: string;
|
||||
accessToken: string;
|
||||
accessToken?: string;
|
||||
}
|
||||
|
||||
export interface LaunchRequest extends Request { }
|
||||
|
||||
export interface IntentRequest extends Request {
|
||||
dialogState: DialogStates;
|
||||
intent: Intent;
|
||||
}
|
||||
|
||||
export interface SlotValue {
|
||||
confirmationStatus: ConfirmationStatuses;
|
||||
name: string;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export interface Intent {
|
||||
confirmationStatus: ConfirmationStatuses;
|
||||
name: string;
|
||||
slots: Record<string, SlotValue>;
|
||||
dialogState?: DialogStates;
|
||||
intent?: Intent;
|
||||
}
|
||||
|
||||
export interface SessionEndedRequest extends Request {
|
||||
reason: string;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export interface Request {
|
||||
type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
|
||||
requestId: string;
|
||||
timeStamp: string;
|
||||
timestamp: string;
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export interface SlotValue {
|
||||
confirmationStatus?: ConfirmationStatuses;
|
||||
name: string;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export interface Intent {
|
||||
confirmationStatus?: ConfirmationStatuses;
|
||||
name: string;
|
||||
slots: Record<string, SlotValue>;
|
||||
}
|
||||
|
||||
export interface ResponseBody {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"object-literal-key-quote": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-method-signature": false,
|
||||
"object-literal-key-quotes": false
|
||||
"object-literal-key-quotes": false,
|
||||
"no-any": false
|
||||
}
|
||||
}
|
||||
|
||||
4892
types/arcgis-js-api/index.d.ts
vendored
4892
types/arcgis-js-api/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
132
types/arcgis-js-api/v3/index.d.ts
vendored
132
types/arcgis-js-api/v3/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript 3.20
|
||||
// Type definitions for ArcGIS API for JavaScript 3.21
|
||||
// Project: https://developers.arcgis.com/javascript/3/
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -18,6 +18,7 @@ declare module "esri" {
|
||||
import BasemapLayer = require("esri/dijit/BasemapLayer");
|
||||
import Symbol = require("esri/symbols/Symbol");
|
||||
import BookmarkItem = require("esri/dijit/BookmarkItem");
|
||||
import TimeInfo = require("esri/layers/TimeInfo");
|
||||
import Color = require("esri/Color");
|
||||
import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase");
|
||||
import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol");
|
||||
@@ -213,6 +214,8 @@ declare module "esri" {
|
||||
isReference?: boolean;
|
||||
/** Initial opacity or transparency of the basemap layer. */
|
||||
opacity?: number;
|
||||
/** A url to a JSON file containing the stylesheet information to render the VectorTileLayer. */
|
||||
styleUrl?: string;
|
||||
/** Specify subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */
|
||||
subDomains?: string[];
|
||||
/** The URL template used to retrieve the tiles. */
|
||||
@@ -221,7 +224,7 @@ declare module "esri" {
|
||||
tileInfo?: TileInfo;
|
||||
/** Define additional tile server domains for the layer. */
|
||||
tileServer?: string[];
|
||||
/** The type of layer, valid values are "BingMapsAerial", "BingMapsHybrid", "BingMapsRoad", "OpenStreetMap", or "WebTiledLayer". */
|
||||
/** The type of layer. */
|
||||
type?: string;
|
||||
/** URL to the ArcGIS Server REST resource that represents a map or image service. */
|
||||
url?: string;
|
||||
@@ -293,6 +296,8 @@ declare module "esri" {
|
||||
outFields?: string[];
|
||||
/** Refresh interval of the layer in minutes. */
|
||||
refreshInterval?: number;
|
||||
/** Time information for the layer, such as start time field, end time field, track id field, layers time extent and the draw time interval. */
|
||||
timeInfo?: TimeInfo;
|
||||
/** Visibility of the layer. */
|
||||
visible?: boolean;
|
||||
}
|
||||
@@ -474,17 +479,17 @@ declare module "esri" {
|
||||
/** The selected color. */
|
||||
color: Color;
|
||||
/** The row size of the palette. */
|
||||
colorsPerRow: number;
|
||||
colorsPerRow?: number;
|
||||
/** The set of available color options. */
|
||||
palette: Color[];
|
||||
palette?: Color[];
|
||||
/** Array of recent colors to show in the recent colors row. */
|
||||
recentColors: Color[];
|
||||
recentColors?: Color[];
|
||||
/** Toggles color selection being required. */
|
||||
required: boolean;
|
||||
required?: boolean;
|
||||
/** Toggles the recent color row. */
|
||||
showRecentColors: boolean;
|
||||
showRecentColors?: boolean;
|
||||
/** Toggles the transparency slider. */
|
||||
showTransparencySlider: boolean;
|
||||
showTransparencySlider?: boolean;
|
||||
}
|
||||
export interface ConnectOriginsToDestinationsOptions {
|
||||
/** The URL to the GPServer used to execute an analysis job. */
|
||||
@@ -879,6 +884,8 @@ declare module "esri" {
|
||||
showSelectFolder?: boolean;
|
||||
}
|
||||
export interface FeatureLayerOptions {
|
||||
/** Indicates whether attribute features containing m-values can be edited. */
|
||||
allowUpdateWithoutMValues?: boolean;
|
||||
/** Enable or disable the auto generalization of features from a non-editable layer in on-demand mode. */
|
||||
autoGeneralize?: boolean;
|
||||
/** Class attribute to set for the layer's node. */
|
||||
@@ -1401,6 +1408,22 @@ declare module "esri" {
|
||||
force3DTransforms?: boolean;
|
||||
/** By default the map creates and uses an out-of-the-box esri/dijit/Popup. */
|
||||
infoWindow?: InfoWindowBase;
|
||||
/** Indicates whether to enable double-click on a map to recenter and zoom in a level by using SHIFT + Click. */
|
||||
isClickRecenter?: boolean;
|
||||
/** Indicates whether double-clicking on map zooms in on extent. */
|
||||
isDoubleClickZoom?: boolean;
|
||||
/** Indicates whether to enable navigation of the map using a keyboard's arrow keys. */
|
||||
isKeyboardNavigation?: boolean;
|
||||
/** Indicates whether all map navigation is enabled. */
|
||||
isMapNavigation?: boolean;
|
||||
/** Indicates whether panning is enabled within the map. */
|
||||
isPan?: boolean;
|
||||
/** Indicates whether pinch zoom navigation is enabled on touch-enabled devices. */
|
||||
isPinchZoom?: boolean;
|
||||
/** Indicates whether to enable a mouse drag to zoom into to a specific region on the map. */
|
||||
isRubberBandZoom?: boolean;
|
||||
/** (Added at version 3.21). */
|
||||
isScrollWheel?: boolean;
|
||||
/** If provided, the map is initialized with the specified levels of detail. */
|
||||
lods?: LOD[];
|
||||
/** Display the esri logo on the map. */
|
||||
@@ -1547,8 +1570,6 @@ declare module "esri" {
|
||||
popupWindowFeatures?: string;
|
||||
/** The ArcGIS for Portal URL. */
|
||||
portalUrl?: string;
|
||||
/** Indicates whether to display social logins such as Google/Facebook. */
|
||||
showSocialLogins?: boolean;
|
||||
}
|
||||
export interface ObliqueViewerOptions {
|
||||
/** Azimuth angle value for which to display oblique images. */
|
||||
@@ -1765,6 +1786,8 @@ declare module "esri" {
|
||||
export interface PrintOptions {
|
||||
/** Set to true if the print service is an asynchronous geoprocessing service. */
|
||||
async?: boolean;
|
||||
/** Additional parameters for the print service. */
|
||||
extraParameters?: any;
|
||||
/** The map to print. */
|
||||
map?: Map;
|
||||
/** An optional array of user-defined templates. */
|
||||
@@ -1891,8 +1914,6 @@ declare module "esri" {
|
||||
expanded?: boolean;
|
||||
/** This the specified graphicsLayer to use for the highlightGraphic and labelGraphic instead of map.graphics. */
|
||||
graphicsLayer?: Layer;
|
||||
/** The symbol used for highlightGraphic. */
|
||||
highlightSymbol?: Symbol;
|
||||
/** A customized infoTemplate for the selected feature. */
|
||||
infoTemplate?: InfoTemplate;
|
||||
/** The text symbol for the label graphic. */
|
||||
@@ -2528,7 +2549,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
findCredential(url: string, userId?: string): Credential;
|
||||
/**
|
||||
* Returns the OAuth configuration for the passed in Portal server URL.
|
||||
* @param url The URL to the Portal.
|
||||
* @param url The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/portal" for your in-house portal.
|
||||
*/
|
||||
findOAuthInfo(url: string): OAuthInfo;
|
||||
/**
|
||||
@@ -2553,7 +2574,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
* Call this method (during your application initialization) with JSON previously obtained from toJson method to re-hydrate the state of identity manager.
|
||||
* @param json The JSON obtained from the toJson method.
|
||||
*/
|
||||
initialize(json: Object): any;
|
||||
initialize(json: Object): void;
|
||||
/** Returns true if the identity manager is busy accepting user input, i.e., the user has invoked signIn and is waiting for a response. */
|
||||
isBusy(): boolean;
|
||||
/**
|
||||
@@ -2576,7 +2597,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
registerServers(serverInfos: ServerInfo[]): void;
|
||||
/**
|
||||
* Registers the given OAuth2 access token with the identity manager.
|
||||
* @param properties See the object specifications table below for the structure of the properties object.
|
||||
* @param properties See the object specifications table below for the structure of the properties object.
|
||||
*/
|
||||
registerToken(properties: any): void;
|
||||
/**
|
||||
@@ -2889,8 +2910,6 @@ declare module "esri/arcgis/OAuthInfo" {
|
||||
popupWindowFeatures: string;
|
||||
/** The ArcGIS for Portal URL. */
|
||||
portalUrl: string;
|
||||
/** Indicates whether to display social logins like Google/Facebook. */
|
||||
showSocialLogins: boolean;
|
||||
/**
|
||||
* Creates a new OAuthInfo given the specified parameters.
|
||||
* @param params Various options to configure the OAuthInfo object.
|
||||
@@ -2947,6 +2966,8 @@ declare module "esri/arcgis/Portal" {
|
||||
defaultBasemap: any;
|
||||
/** The default extent for the map the portal displays in the map viewer. */
|
||||
defaultExtent: any;
|
||||
/** The default vector basemap to use for the portal. */
|
||||
defaultVectorBasemap: any;
|
||||
/** A description of the organization / portal. */
|
||||
description: string;
|
||||
/** The featured groups for the portal. */
|
||||
@@ -2957,6 +2978,8 @@ declare module "esri/arcgis/Portal" {
|
||||
featuredItemsGroupQuery: string;
|
||||
/** The query that identifies the group containing features items for the gallery. */
|
||||
galleryTemplatesGroupQuery: string;
|
||||
/** Helper services provided by the portal. */
|
||||
helperServices: any;
|
||||
/** The group that contains featured content to be displayed on the home page. */
|
||||
homePageFeaturedContent: string;
|
||||
/** The number of featured items that can be displayed on the home page. */
|
||||
@@ -2991,7 +3014,7 @@ declare module "esri/arcgis/Portal" {
|
||||
portalProperties: any;
|
||||
/** The URL to the thumbnail of the portal. */
|
||||
portalThumbnail: string;
|
||||
/** URL to the portal. */
|
||||
/** The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest/" for ArcGIS Online and "https://www.example.com/arcgis/sharing/rest/" for your in-house portal. */
|
||||
portalUrl: string;
|
||||
/** The region for the organization. */
|
||||
region: string;
|
||||
@@ -3013,7 +3036,7 @@ declare module "esri/arcgis/Portal" {
|
||||
thumbnailUrl: string;
|
||||
/** Sets the units of measure for the organization's users. */
|
||||
units: string;
|
||||
/** The portal url. */
|
||||
/** The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/arcgis" for your in-house portal. */
|
||||
url: string;
|
||||
/** The prefix selected by the organization's administrator to be used with the customBaseURL. */
|
||||
urlKey: string;
|
||||
@@ -3021,9 +3044,13 @@ declare module "esri/arcgis/Portal" {
|
||||
user: PortalUser;
|
||||
/** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */
|
||||
useStandardizedQuery: boolean;
|
||||
/** Whether an organization has opted in to use the vector tile basemaps. */
|
||||
useVectorBasemaps: boolean;
|
||||
/** The query that defines the vector tiles basemaps that should be displayed in the Basemap Gallery when useVectorBasemaps is true. */
|
||||
vectorBasemapGalleryGroupQuery: string;
|
||||
/**
|
||||
* Creates a new Portal object.
|
||||
* @param url URL to the ArcGIS.com site or in-house portal.
|
||||
* @param url The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/arcgis" for your in-house portal.
|
||||
*/
|
||||
constructor(url: string);
|
||||
/** Returns a PortalUser object that describes the user currently signed in to the portal. */
|
||||
@@ -3111,6 +3138,11 @@ declare module "esri/arcgis/Portal" {
|
||||
url: string;
|
||||
/** Get the current members for the group. */
|
||||
getMembers(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal group.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
/**
|
||||
* Execute a query against the group to return a deferred that when resolved returns PortalQueryResult that contain a results array of PortalItem objects that match the input query.
|
||||
* @param queryParams The input query parameters.
|
||||
@@ -3196,6 +3228,11 @@ declare module "esri/arcgis/Portal" {
|
||||
getComments(): any;
|
||||
/** Returns the rating (if any) given to the item. */
|
||||
getRating(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal item.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
/**
|
||||
* Updates an item comment.
|
||||
* @param comment A PortalComment that contains the comment updates.
|
||||
@@ -3274,6 +3311,11 @@ declare module "esri/arcgis/Portal" {
|
||||
getNotifications(): any;
|
||||
/** Access the tag objects that have been created by the portal user. */
|
||||
getTags(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal user.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3440,7 +3482,7 @@ declare module "esri/dijit/BasemapGallery" {
|
||||
import esri = require("esri");
|
||||
import Basemap = require("esri/dijit/Basemap");
|
||||
|
||||
/** The BasemapGallery dijit displays a collection basemaps from ArcGIS.com or a user-defined set of map or image services. */
|
||||
/** The BasemapGallery dijit displays a collection of basemaps from ArcGIS.com or a user-defined set of map or image services. */
|
||||
class BasemapGallery {
|
||||
/** List of basemaps displayed in the BasemapGallery. */
|
||||
basemaps: Basemap[];
|
||||
@@ -3508,6 +3550,8 @@ declare module "esri/dijit/BasemapLayer" {
|
||||
fullExtent: Extent;
|
||||
/** The initial extent of the layer. */
|
||||
initialExtent: Extent;
|
||||
/** A url to a JSON file containing the stylesheet information to render the VectorTileLayer. */
|
||||
styleUrl: string;
|
||||
/** The subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */
|
||||
subDomains: string[];
|
||||
/** The tile info for the layer including lods, rows, cols, origin and spatial reference. */
|
||||
@@ -5288,6 +5332,8 @@ declare module "esri/dijit/PopupTemplate" {
|
||||
|
||||
/** The PopupTemplate class extends esri/InfoTemplate and provides support for defining a layout. */
|
||||
class PopupTemplate extends InfoTemplate {
|
||||
/** An array of objects that reference Arcade expressions. */
|
||||
expressionInfos: any[];
|
||||
/** The popup definition defined as a JavaScript object. */
|
||||
info: any;
|
||||
/**
|
||||
@@ -5640,6 +5686,9 @@ declare module "esri/dijit/SymbolStyler" {
|
||||
startup(): void;
|
||||
/** Saves the recent fill and outline colors. */
|
||||
storeColors(): void;
|
||||
/** Fired every time an edit is committed. */
|
||||
on(type: "style-update", listener: (event: { target: SymbolStyler }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = SymbolStyler;
|
||||
}
|
||||
@@ -5865,7 +5914,7 @@ declare module "esri/dijit/analysis/AnalysisBase" {
|
||||
checkJobStatus(jobId: string): void;
|
||||
/**
|
||||
* Starts an analysis tool.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
*/
|
||||
execute(params: string): void;
|
||||
/**
|
||||
@@ -8633,6 +8682,8 @@ declare module "esri/graphic" {
|
||||
getShape(): any;
|
||||
/** Returns one or more dojox/gfx/shape.Shape used to draw the graphic. */
|
||||
getShapes(): any[];
|
||||
/** In contrast to the getLayer method, getSouceLayer does not change when a graphic is added to another layer. */
|
||||
getSourceLayer(): Layer;
|
||||
/** Returns the title string based on attributes and infoTemplate values. */
|
||||
getTitle(): string;
|
||||
/** Hides the graphic. */
|
||||
@@ -9471,6 +9522,8 @@ declare module "esri/layers/FeatureLayer" {
|
||||
advancedQueryCapabilities: any;
|
||||
/** Returns true if the geometry of the features in the layer can be edited, false otherwise. */
|
||||
allowGeometryUpdates: boolean;
|
||||
/** Indicates whether attribute features containing m-values can be edited. */
|
||||
allowUpdateWithoutMValues: boolean;
|
||||
/** The URL, when available, where the layer's attribution data is stored. */
|
||||
attributionDataUrl: string;
|
||||
/** Information about the capabilities enabled for this layer. */
|
||||
@@ -10279,6 +10332,8 @@ declare module "esri/layers/KMLLayer" {
|
||||
getFeature(featureInfo: any): any;
|
||||
/** Get an array of map layers that were created to draw placemarks, ground and screen overlays. */
|
||||
getLayers(): Layer[];
|
||||
/** Refreshes the features in the KML Layer. */
|
||||
refresh(): void;
|
||||
/**
|
||||
* Set the visibility for the specified folder.
|
||||
* @param folder A KML folder.
|
||||
@@ -11034,6 +11089,8 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
fullExtent: Extent;
|
||||
/** The initial extent of the layer. */
|
||||
initialExtent: Extent;
|
||||
/** Name of the vector tile layer. */
|
||||
name: string;
|
||||
/** The spatial reference of the layer. */
|
||||
spatialReference: SpatialReference;
|
||||
/** Contains information about the tiling scheme for the layer. */
|
||||
@@ -11055,6 +11112,10 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
setStyle(styleUrl: string | any): void;
|
||||
/** Fires when the style is changed on the layer. */
|
||||
on(type: "style-change", listener: (event: { style: any; target: VectorTileLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer has finished updating its content. */
|
||||
on(type: "update-end", listener: (event: { target: VectorTileLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer begins to update its content. */
|
||||
on(type: "update-start", listener: (event: { target: VectorTileLayer }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = VectorTileLayer;
|
||||
@@ -11773,12 +11834,18 @@ declare module "esri/map" {
|
||||
isDoubleClickZoom: boolean;
|
||||
/** When true, keyboard navigation is enabled. */
|
||||
isKeyboardNavigation: boolean;
|
||||
/** Indicates whether all map navigation is enabled. */
|
||||
isMapNavigation: boolean;
|
||||
/** When true, map panning is enabled using the mouse. */
|
||||
isPan: boolean;
|
||||
/** When true, pan arrows are displayed around the edge of the map. */
|
||||
isPanArrows: boolean;
|
||||
/** Indicates whether pinch zoom navigation is enabled on touch-enabled devices. */
|
||||
isPinchZoom: boolean;
|
||||
/** When true, rubberband zoom is enabled. */
|
||||
isRubberBandZoom: boolean;
|
||||
/** It indicates whether map navigation based on mouse scroll wheel is enabled. */
|
||||
isScrollWheel: boolean;
|
||||
/** When true, the mouse scroll wheel zoom is enabled. */
|
||||
isScrollWheelZoom: boolean;
|
||||
/** When true, shift double click zoom is enabled. */
|
||||
@@ -11853,8 +11920,11 @@ declare module "esri/map" {
|
||||
disableMapNavigation(): void;
|
||||
/** Disallows panning a map using the mouse. */
|
||||
disablePan(): void;
|
||||
disablePinchZoom(): void;
|
||||
/** Disallows zooming in or out on a map using a bounding box. */
|
||||
disableRubberBandZoom(): void;
|
||||
/** Disables navigation of the map based on mouse scroll wheel. */
|
||||
disableScrollWheel(): void;
|
||||
/** Disallows zooming in or out on a map using the mouse scroll wheel. */
|
||||
disableScrollWheelZoom(): void;
|
||||
/** Disallows shift double clicking on a map to zoom in a level and center the map. */
|
||||
@@ -11871,8 +11941,12 @@ declare module "esri/map" {
|
||||
enableMapNavigation(): void;
|
||||
/** Permits users to pan a map using the mouse. */
|
||||
enablePan(): void;
|
||||
/** Enables the user to work with pinch zoom navigation for touch-enabled devices. */
|
||||
enablePinchZoom(): void;
|
||||
/** Permits users to zoom in or out on a map using a bounding box. */
|
||||
enableRubberBandZoom(): void;
|
||||
/** Enables the user to navigate the map based on mouse scroll wheel. */
|
||||
enableScrollWheel(): void;
|
||||
/** Permits users to zoom in or out on a map using the mouse scroll wheel. */
|
||||
enableScrollWheelZoom(): void;
|
||||
/** Permits users to shift double click on a map to zoom in a level and center the map. */
|
||||
@@ -12947,7 +13021,7 @@ declare module "esri/renderers/HeatmapRenderer" {
|
||||
import esri = require("esri");
|
||||
import Renderer = require("esri/renderers/Renderer");
|
||||
|
||||
/** The HeatmapRenderer renders point data into a raster visualization that emphasizes areas of higher density or weighted values. */
|
||||
/** The HeatmapRenderer renders feature layer point data into a raster visualization that emphasizes areas of higher density or weighted values. */
|
||||
class HeatmapRenderer extends Renderer {
|
||||
/** The radius (in pixels) of the circle over which the majority of each points value is spread out over. */
|
||||
blurRadius: number;
|
||||
@@ -13052,7 +13126,7 @@ declare module "esri/renderers/Renderer" {
|
||||
* Returns the visual variable of the specified type.
|
||||
* @param type The type of visual variable desired.
|
||||
*/
|
||||
getVisualVariablesForType(type: string): any;
|
||||
getVisualVariablesForType(type: string): any[];
|
||||
/** Indicates if the renderer has defined visualVariables. */
|
||||
hasVisualVariables(): boolean;
|
||||
/**
|
||||
@@ -14873,7 +14947,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
distance(params: DistanceParameters, callback?: Function, errback?: Function): any;
|
||||
/**
|
||||
* Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs during task execution.
|
||||
*/
|
||||
@@ -14945,7 +15019,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
simplify(geometries: Geometry[], callback?: Function, errback?: Function): any;
|
||||
/**
|
||||
* Converts an array of xy-coordinates into well-known strings based on the conversion type and spatial reference supplied by the user.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs during task execution.
|
||||
*/
|
||||
@@ -15890,7 +15964,7 @@ declare module "esri/tasks/RouteParameters" {
|
||||
startTimeIsUTC: boolean;
|
||||
/** The set of stops loaded as network locations during analysis. */
|
||||
stops: any;
|
||||
/** If true , the TimeWindowStart and TimeWindowEnd attributes of a stop are in UTC time (milliseconds). */
|
||||
/** If true, the TimeWindowStart and TimeWindowEnd attributes of a stop are in UTC time (milliseconds). */
|
||||
timeWindowsAreUTC: boolean;
|
||||
/** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */
|
||||
travelMode: any;
|
||||
@@ -17172,7 +17246,7 @@ declare module "esri/tasks/locator" {
|
||||
*/
|
||||
constructor(url: string);
|
||||
/**
|
||||
* Find address candidates for the input addresses.
|
||||
* Find address candidates for multiple input addresses.
|
||||
* @param params The input addresses in the format supported by the geocoding service.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback The function to call if an error occurs on the server during task execution.
|
||||
@@ -17180,7 +17254,7 @@ declare module "esri/tasks/locator" {
|
||||
addressesToLocations(params: any, callback: Function, errback: Function): any;
|
||||
/**
|
||||
* Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address parameter.
|
||||
* @param params Specify the address and optionally specify the outFields and searchExtent.
|
||||
* @param params Specify at least the address and optionally other properties.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs on the Server during task execution.
|
||||
*/
|
||||
|
||||
2
types/archiver/index.d.ts
vendored
2
types/archiver/index.d.ts
vendored
@@ -44,8 +44,6 @@ declare namespace archiver {
|
||||
glob(pattern: string, options?: glob.IOptions, data?: EntryData): this;
|
||||
finalize(): this;
|
||||
|
||||
pipe(stream: stream.Writable): void;
|
||||
|
||||
setFormat(format: string): this;
|
||||
setModule(module: Function): this;
|
||||
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
|
||||
|
||||
import AutoLaunch = require('auto-launch');
|
||||
|
||||
var a1 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
const minecraftAutoLauncher = new AutoLaunch({
|
||||
name: 'Minecraft',
|
||||
path: '/Applications/Minecraft.app',
|
||||
mac: {
|
||||
useLaunchAgent: true
|
||||
}
|
||||
});
|
||||
|
||||
var a2 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
path: '/Applications/Foo.app',
|
||||
isHidden: true,
|
||||
});
|
||||
minecraftAutoLauncher.enable();
|
||||
minecraftAutoLauncher.disable();
|
||||
|
||||
a1.enable();
|
||||
a2.disable();
|
||||
|
||||
a1.isEnabled(function(enabled: boolean) {
|
||||
if (enabled) {
|
||||
return;
|
||||
minecraftAutoLauncher.isEnabled()
|
||||
.then((isEnabled) => {
|
||||
if (isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
a1.enable(function(err){ console.log(err.message); });
|
||||
});
|
||||
minecraftAutoLauncher.enable();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
72
types/auto-launch/index.d.ts
vendored
72
types/auto-launch/index.d.ts
vendored
@@ -1,41 +1,47 @@
|
||||
// Type definitions for auto-launch 0.1.18
|
||||
// Type definitions for auto-launch 5.0
|
||||
// Project: https://github.com/Teamwork/node-auto-launch
|
||||
// Definitions by: rhysd <https://github.com/rhysd>
|
||||
// Definitions by: rhysd <https://github.com/rhysd>, Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface AutoLaunchOption {
|
||||
/**
|
||||
* Application name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Hidden on launch or not. Default is false.
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* Path to application directory.
|
||||
* Default is process.execPath.
|
||||
*/
|
||||
path?: string;
|
||||
interface AutoLaunchOptions {
|
||||
/**
|
||||
* Application name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Path to application. Default is `process.execPath`.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* Hidden on launch. Default is `false`.
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* For Mac-only options.
|
||||
*/
|
||||
mac?: {
|
||||
/**
|
||||
* By default, AppleScript is used to add a Login Item. If this is `true`, Launch Agent will be used to auto-launch your app. Defaults is `false`.
|
||||
*/
|
||||
useLaunchAgent?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
declare class AutoLaunch {
|
||||
constructor(opts: AutoLaunchOption);
|
||||
/**
|
||||
* Enables to launch at start up
|
||||
*/
|
||||
enable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Disables to launch at start up
|
||||
*/
|
||||
disable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Returns if auto start up is enabled
|
||||
*/
|
||||
isEnabled(callback: (enabled: boolean) => void): void;
|
||||
constructor(options: AutoLaunchOptions);
|
||||
|
||||
/**
|
||||
* Enables auto-launch at start up.
|
||||
*/
|
||||
enable(): Promise<void>;
|
||||
/**
|
||||
* Disables auto-launch at start up.
|
||||
*/
|
||||
disable(): Promise<void>;
|
||||
/**
|
||||
* Returns true if auto-launch is enabled.
|
||||
*/
|
||||
isEnabled(): Promise<boolean>;
|
||||
}
|
||||
|
||||
declare module "auto-launch" {
|
||||
var al: typeof AutoLaunch;
|
||||
export = al;
|
||||
}
|
||||
export = AutoLaunch;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"auto-launch-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/// <reference types="babylon" />
|
||||
|
||||
|
||||
|
||||
// Example from https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
import {parse} from 'babylon';
|
||||
import generate from 'babel-generator';
|
||||
@@ -14,13 +10,13 @@ ast.loc.start;
|
||||
|
||||
const output = generate(ast, { /* options */ }, code);
|
||||
|
||||
|
||||
// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator
|
||||
let result = generate(ast, {
|
||||
retainLines: false,
|
||||
compact: "auto",
|
||||
concise: false,
|
||||
quotes: "double",
|
||||
jsonCompatibleStrings: true,
|
||||
// ...
|
||||
}, code);
|
||||
result.code;
|
||||
|
||||
27
types/babel-generator/index.d.ts
vendored
27
types/babel-generator/index.d.ts
vendored
@@ -1,12 +1,10 @@
|
||||
// Type definitions for babel-generator v6.7
|
||||
// Type definitions for babel-generator 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Johnny Estilles <https://github.com/johnnyestilles>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
/**
|
||||
* Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.
|
||||
@@ -15,18 +13,17 @@ type Node = t.Node;
|
||||
* @param code - the original source code, used for source maps.
|
||||
* @returns - an object containing the output code and source map.
|
||||
*/
|
||||
export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
export default function generate(ast: t.Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
|
||||
export interface GeneratorOptions {
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the start of the output file.
|
||||
*/
|
||||
*/
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
*/
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/**
|
||||
@@ -34,7 +31,7 @@ export interface GeneratorOptions {
|
||||
* By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment
|
||||
* contains `@preserve` or `@license`.
|
||||
*/
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
shouldPrintComment?(comment: string): boolean;
|
||||
|
||||
/**
|
||||
* Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).
|
||||
@@ -60,7 +57,7 @@ export interface GeneratorOptions {
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean;
|
||||
concise?: boolean;
|
||||
|
||||
/**
|
||||
* The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`.
|
||||
@@ -70,7 +67,7 @@ export interface GeneratorOptions {
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string;
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
@@ -92,10 +89,14 @@ export interface GeneratorOptions {
|
||||
* This will only be used if `code` is a string.
|
||||
*/
|
||||
sourceFileName?: string;
|
||||
|
||||
/**
|
||||
* Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";
|
||||
*/
|
||||
jsonCompatibleStrings?: boolean;
|
||||
}
|
||||
|
||||
export interface GeneratorResult {
|
||||
map: Object;
|
||||
map: {};
|
||||
code: string;
|
||||
}
|
||||
|
||||
|
||||
3
types/babel-generator/tslint.json
Normal file
3
types/babel-generator/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as block from "bem-cn";
|
||||
import { Settings } from "bem-cn";
|
||||
|
||||
// expected 'block'
|
||||
block("block")();
|
||||
@@ -44,3 +45,10 @@ block("block")("elem");
|
||||
|
||||
// expected 'block block--mod-value'
|
||||
block("block")({ mod: "value"});
|
||||
|
||||
// I can use bem-cn interfaces
|
||||
const customSettings: Settings = {
|
||||
ns: 'prefix'
|
||||
};
|
||||
|
||||
block.setup(customSettings);
|
||||
|
||||
66
types/bem-cn/index.d.ts
vendored
66
types/bem-cn/index.d.ts
vendored
@@ -3,39 +3,39 @@
|
||||
// Definitions by: Vitaly Selkin <https://github.com/selkinvitaly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type StateFn = (states: { [key: string]: boolean }) => Inner;
|
||||
type StateFn = (states: { [key: string]: boolean }) => BemCn.Inner;
|
||||
declare function BemCn(name: string): BemCn.Inner;
|
||||
|
||||
interface Modifications {
|
||||
[key: string]: (string | boolean);
|
||||
declare namespace BemCn {
|
||||
function reset(): void;
|
||||
function setup(settings?: Settings): void;
|
||||
|
||||
interface Modifications {
|
||||
[key: string]: (string | boolean);
|
||||
}
|
||||
|
||||
interface Inner {
|
||||
(elem: string | Modifications): Inner;
|
||||
(elem: string, mods: Modifications): Inner;
|
||||
(): string;
|
||||
|
||||
mix(mixes: string | string[]): Inner;
|
||||
has: StateFn;
|
||||
state: StateFn;
|
||||
is: StateFn;
|
||||
toString(): string;
|
||||
valueOf(): string;
|
||||
split(separator: string, limit?: number): string[];
|
||||
}
|
||||
|
||||
interface Settings {
|
||||
ns?: string;
|
||||
el?: string;
|
||||
mod?: string;
|
||||
modValue?: string;
|
||||
classMap?: { [className: string]: string } | null;
|
||||
}
|
||||
}
|
||||
|
||||
interface Block {
|
||||
(name: string): Inner;
|
||||
|
||||
reset(): void;
|
||||
setup(settings?: Settings): void;
|
||||
}
|
||||
|
||||
interface Inner {
|
||||
(elem: string | Modifications): Inner;
|
||||
(elem: string, mods: Modifications): Inner;
|
||||
(): string;
|
||||
|
||||
mix(mixes: string | string[]): Inner;
|
||||
has: StateFn;
|
||||
state: StateFn;
|
||||
is: StateFn;
|
||||
toString(): string;
|
||||
split(separator: string, limit?: number): string[];
|
||||
}
|
||||
|
||||
interface Settings {
|
||||
ns?: string;
|
||||
el?: string;
|
||||
mod?: string;
|
||||
modValue?: string;
|
||||
classMap?: { [className: string]: string } | null;
|
||||
}
|
||||
|
||||
declare const block: Block;
|
||||
export = block;
|
||||
export as namespace BemCn;
|
||||
export = BemCn;
|
||||
|
||||
2
types/chart.js/index.d.ts
vendored
2
types/chart.js/index.d.ts
vendored
@@ -130,7 +130,7 @@ declare namespace Chart {
|
||||
}
|
||||
|
||||
interface ChartData {
|
||||
labels?: string[];
|
||||
labels?: Array<string | string[]>;
|
||||
datasets?: ChartDataSets[];
|
||||
}
|
||||
|
||||
|
||||
@@ -306,3 +306,5 @@ $.parseHTML(html, null, true);
|
||||
* Not in doc
|
||||
*/
|
||||
$el.toArray();
|
||||
|
||||
cheerio.html($el);
|
||||
|
||||
2
types/cheerio/index.d.ts
vendored
2
types/cheerio/index.d.ts
vendored
@@ -263,7 +263,7 @@ interface CheerioElement {
|
||||
nodeValue: string;
|
||||
}
|
||||
|
||||
interface CheerioAPI extends CheerioSelector {
|
||||
interface CheerioAPI extends CheerioSelector, CheerioStatic {
|
||||
load(html: string, options?: CheerioOptionsInterface): CheerioStatic;
|
||||
load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic;
|
||||
}
|
||||
|
||||
2
types/ckeditor/index.d.ts
vendored
2
types/ckeditor/index.d.ts
vendored
@@ -1681,7 +1681,7 @@ declare namespace CKEDITOR {
|
||||
function addUIElement(typeName: string, builder: Function): void;
|
||||
function cancelButton(): void;
|
||||
function exists(name: string | number): void; // NOTE: documentation says object, but it's an array accessor, so really a string or number will work
|
||||
function getCurrent(): void;
|
||||
function getCurrent(): CKEDITOR.dialog;
|
||||
function isTabEnabled(editor: CKEDITOR.editor, dialogName: string, tabName: string): boolean;
|
||||
function okButton(): void;
|
||||
}
|
||||
|
||||
15
types/codemirror/codemirror-showhint.d.ts
vendored
15
types/codemirror/codemirror-showhint.d.ts
vendored
@@ -1,6 +1,8 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/marijnh/CodeMirror
|
||||
// Definitions by: jacqt <https://github.com/jacqt>, basarat <https://github.com/basarat>
|
||||
// Definitions by: jacqt <https://github.com/jacqt>
|
||||
// basarat <https://github.com/basarat>
|
||||
// mbilsing <https://github.com/mbilsing>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_show-hint
|
||||
@@ -16,7 +18,7 @@ declare module "codemirror" {
|
||||
and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
|
||||
from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
|
||||
selectedHint property (an integer) can be added to the completion object to control the initially selected hint. */
|
||||
function showHint(cm: CodeMirror.Doc, hinter?: HintFunction, options?: ShowHintOptions): void;
|
||||
function showHint(cm: CodeMirror.Editor, hinter?: HintFunction, options?: ShowHintOptions): void;
|
||||
|
||||
interface Hints {
|
||||
from: Position;
|
||||
@@ -32,7 +34,7 @@ declare module "codemirror" {
|
||||
displayText?: string;
|
||||
from?: Position;
|
||||
/** Called if a completion is picked. If provided *you* are responsible for applying the completion */
|
||||
hint?: (cm: any, data: Hints, cur: Hint) => void;
|
||||
hint?: (cm: CodeMirror.Editor, data: Hints, cur: Hint) => void;
|
||||
render?: (element: HTMLLIElement, data: Hints, cur: Hint) => void;
|
||||
to?: Position;
|
||||
}
|
||||
@@ -41,18 +43,15 @@ declare module "codemirror" {
|
||||
/** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */
|
||||
on(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
|
||||
off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
|
||||
}
|
||||
|
||||
interface Doc {
|
||||
showHint: (options: ShowHintOptions) => void;
|
||||
}
|
||||
|
||||
interface HintFunction {
|
||||
(doc: CodeMirror.Doc): Hints;
|
||||
(cm: CodeMirror.Editor): Hints;
|
||||
}
|
||||
|
||||
interface AsyncHintFunction {
|
||||
(doc: CodeMirror.Doc, callback: (hints: Hints) => any): any;
|
||||
(cm: CodeMirror.Editor, callback: (hints: Hints) => any): any;
|
||||
async?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
|
||||
var doc = new CodeMirror.Doc('text');
|
||||
var cm = CodeMirror(document.body, {value: 'text'});
|
||||
var pos = new CodeMirror.Pos(2, 3);
|
||||
CodeMirror.showHint(doc);
|
||||
CodeMirror.showHint(doc, function (cm) {
|
||||
CodeMirror.showHint(cm);
|
||||
CodeMirror.showHint(cm, function (cm) {
|
||||
return {
|
||||
from: pos,
|
||||
list: ["one", "two"],
|
||||
to: pos
|
||||
};
|
||||
});
|
||||
CodeMirror.showHint(doc, function (cm) {
|
||||
CodeMirror.showHint(cm, function (cm) {
|
||||
return {
|
||||
from: pos,
|
||||
list: [
|
||||
@@ -32,7 +32,7 @@ CodeMirror.showHint(doc, function (cm) {
|
||||
};
|
||||
});
|
||||
var asyncHintFunc : CodeMirror.AsyncHintFunction =
|
||||
(doc: CodeMirror.Doc, callback: (hints: CodeMirror.Hints) => any) => {
|
||||
(cm: CodeMirror.Editor, callback: (hints: CodeMirror.Hints) => any) => {
|
||||
callback({
|
||||
from: pos,
|
||||
list: ["one", "two"],
|
||||
@@ -41,7 +41,7 @@ var asyncHintFunc : CodeMirror.AsyncHintFunction =
|
||||
};
|
||||
asyncHintFunc.async = true;
|
||||
|
||||
doc.showHint({
|
||||
cm.showHint({
|
||||
completeSingle: false,
|
||||
hint: asyncHintFunc
|
||||
})
|
||||
|
||||
10
types/command-line-args/command-line-args-tests.ts
Normal file
10
types/command-line-args/command-line-args-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import commandLineArgs = require('command-line-args');
|
||||
|
||||
const optionDefinitions = [
|
||||
{ name: 'verbose', alias: 'v', type: Boolean },
|
||||
{ name: 'src', type: String, multiple: true, defaultOption: true },
|
||||
{ name: 'timeout', alias: 't', type: Number }
|
||||
];
|
||||
|
||||
const options = commandLineArgs(optionDefinitions);
|
||||
|
||||
74
types/command-line-args/index.d.ts
vendored
Normal file
74
types/command-line-args/index.d.ts
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
// Type definitions for command-line-args 4.0.6
|
||||
// Project: https://github.com/75lb/command-line-args
|
||||
// Definitions by: CzBuCHi <https://github.com/CzBuCHi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Returns an object containing all options set on the command line. By default it parses the global [`process.argv`](https://nodejs.org/api/process.html#process_process_argv) array.
|
||||
*
|
||||
* By default, an exception is thrown if the user sets an unknown option (one without a valid [definition](#exp_module_definition--OptionDefinition)). To enable __partial parsing__, invoke `commandLineArgs` with the `partial` option - all unknown arguments will be returned in the `_unknown` property.
|
||||
*
|
||||
*
|
||||
* @param {module:definition[]} - An array of [OptionDefinition](#exp_module_definition--OptionDefinition) objects
|
||||
* @param [options] {object} - Options.
|
||||
* @param [options.argv] {string[]} - An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
* @param [options.partial] {boolean} - If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
* @returns {object}
|
||||
* @throws `UNKNOWN_OPTION` if `options.partial` is false and the user set an undefined option
|
||||
* @throws `NAME_MISSING` if an option definition is missing the required `name` property
|
||||
* @throws `INVALID_TYPE` if an option definition has a `type` value that's not a function
|
||||
* @throws `INVALID_ALIAS` if an alias is numeric, a hyphen or a length other than 1
|
||||
* @throws `DUPLICATE_NAME` if an option definition name was used more than once
|
||||
* @throws `DUPLICATE_ALIAS` if an option definition alias was used more than once
|
||||
* @throws `DUPLICATE_DEFAULT_OPTION` if more than one option definition has `defaultOption: true`
|
||||
* @alias module:command-line-args
|
||||
*/
|
||||
declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any;
|
||||
|
||||
declare module commandLineArgs {
|
||||
|
||||
export interface OptionDefinition {
|
||||
/**
|
||||
* The only required definition property is name, the value of each option will be either a Boolean or string.
|
||||
*/
|
||||
name: string,
|
||||
/**
|
||||
* The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
|
||||
*/
|
||||
type?: (arg: string) => any,
|
||||
/**
|
||||
* getopt-style short option names. Can be any single character (unicode included) except a digit or hypen.
|
||||
*/
|
||||
alias?: string,
|
||||
/**
|
||||
* Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified).
|
||||
*/
|
||||
multiple?: boolean,
|
||||
/**
|
||||
* Any unclaimed command-line args will be set on this option. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. $ myapp *.js instead of $ myapp --files *.js).
|
||||
*/
|
||||
defaultOption?: boolean,
|
||||
/**
|
||||
* An initial value for the option.
|
||||
*/
|
||||
defaultValue?: any,
|
||||
/**
|
||||
* When your app has a large amount of options it makes sense to organise them in groups.
|
||||
* There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition).
|
||||
*/
|
||||
group?: string | string[],
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
*/
|
||||
argv?: string[];
|
||||
/**
|
||||
* If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
*/
|
||||
partial?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = commandLineArgs;
|
||||
22
types/command-line-args/tsconfig.json
Normal file
22
types/command-line-args/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"command-line-args-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import commandLineCommands = require('command-line-commands');
|
||||
|
||||
const commands = [null, 'first', 'second'];
|
||||
|
||||
const { command, argv } = commandLineCommands(commands, ['first', '--arg']);
|
||||
|
||||
|
||||
17
types/command-line-commands/index.d.ts
vendored
Normal file
17
types/command-line-commands/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for command-line-commands 2.0.0
|
||||
// Project: https://github.com/75lb/command-line-commands
|
||||
// Definitions by: CzBuCHi <https://github.com/CzBuCHi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Parses the `argv` value supplied (or `process.argv` by default), extracting and returning the `command` and remainder of `argv`. The command will be the first value in the `argv` array unless it is an option (e.g. `--help`).
|
||||
*
|
||||
* @param {string|string[]} - One or more command strings, one of which the user must supply. Include `null` to represent "no command" (effectively making a command optional).
|
||||
* @param [argv] {string[]} - An argv array, defaults to the global `process.argv` if not supplied.
|
||||
* @returns {{ command: string, argv: string[] }}
|
||||
* @throws `INVALID_COMMAND` - user supplied a command not specified in `commands`.
|
||||
*/
|
||||
declare function commandLineCommands(commands: (string | null)[], argv?: string[]): { command: string | null, argv: string[] };
|
||||
|
||||
export = commandLineCommands;
|
||||
|
||||
22
types/command-line-commands/tsconfig.json
Normal file
22
types/command-line-commands/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"command-line-commands-tests.ts"
|
||||
]
|
||||
}
|
||||
16
types/cordova-plugin-badge/cordova-plugin-badge-tests.ts
Normal file
16
types/cordova-plugin-badge/cordova-plugin-badge-tests.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference types="cordova" />
|
||||
|
||||
function callback(badgeOrGranted: number | boolean) {
|
||||
console.log(badgeOrGranted);
|
||||
}
|
||||
|
||||
window.cordova.plugins.notification.badge.clear();
|
||||
window.cordova.plugins.notification.badge.set(10, callback);
|
||||
window.cordova.plugins.notification.badge.decrease(2, callback);
|
||||
window.cordova.plugins.notification.badge.increase(5, callback);
|
||||
window.cordova.plugins.notification.badge.hasPermission(callback);
|
||||
window.cordova.plugins.notification.badge.requestPermission(callback);
|
||||
window.cordova.plugins.notification.badge.get(callback);
|
||||
window.cordova.plugins.notification.badge.configure({
|
||||
autoClear: true
|
||||
});
|
||||
25
types/cordova-plugin-badge/index.d.ts
vendored
Normal file
25
types/cordova-plugin-badge/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for cordova-plugin-badge 0.8
|
||||
// Project: https://github.com/katzer/cordova-plugin-badge
|
||||
// Definitions by: Tim Brust <https://github.com/timbru31>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface CordovaPlugins {
|
||||
notification: {
|
||||
badge: CordovaPluginBadge;
|
||||
};
|
||||
}
|
||||
|
||||
interface CordovaPluginBadgeOptions {
|
||||
autoClear: boolean;
|
||||
}
|
||||
|
||||
interface CordovaPluginBadge {
|
||||
clear(callback?: (badge: number) => void, scope?: any): void;
|
||||
set(badge?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
get(callback?: (badge: number) => void, scope?: any): void;
|
||||
increase(count?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
decrease(count?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
hasPermission(callback?: (granted: boolean) => void, scope?: any): void;
|
||||
requestPermission(callback?: (granted: boolean) => void, scope?: any): void;
|
||||
configure(config: CordovaPluginBadgeOptions): CordovaPluginBadgeOptions;
|
||||
}
|
||||
23
types/cordova-plugin-badge/tsconfig.json
Normal file
23
types/cordova-plugin-badge/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-plugin-badge-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cordova-plugin-badge/tslint.json
Normal file
1
types/cordova-plugin-badge/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
16
types/country-list/country-list-tests.ts
Normal file
16
types/country-list/country-list-tests.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import countries from 'country-list';
|
||||
const Countries = countries();
|
||||
|
||||
Countries.getCode('Barbados'); // BB
|
||||
|
||||
Countries.getCodes();
|
||||
|
||||
Countries.getCodeList();
|
||||
|
||||
Countries.getData();
|
||||
|
||||
Countries.getName('BB'); // Barbados
|
||||
|
||||
Countries.getNameList();
|
||||
|
||||
Countries.getNames();
|
||||
41
types/country-list/index.d.ts
vendored
Normal file
41
types/country-list/index.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Type definitions for country-list 1.1
|
||||
// Project: https://github.com/fannarsh/country-list
|
||||
// Definitions by: Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function Countries(): {
|
||||
/**
|
||||
* Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined.
|
||||
*/
|
||||
getName(code: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Expects the English country name. Returns the code for that country. If not found, it returns undefined.
|
||||
*/
|
||||
getCode(name: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Returns an array of all country names.
|
||||
*/
|
||||
getNames(): string[];
|
||||
|
||||
/**
|
||||
* Returns an array of all country codes.
|
||||
*/
|
||||
getCodes(): string[];
|
||||
|
||||
/**
|
||||
* Returns a key-value object of all countries using the name as key.
|
||||
*/
|
||||
getNameList(): {[name: string]: string};
|
||||
|
||||
/**
|
||||
* Returns a key-value object of all countries using the code as key.
|
||||
*/
|
||||
getCodeList(): {[code: string]: string};
|
||||
|
||||
/**
|
||||
* Returns an array of all country information, in the same format as it gets imported.
|
||||
*/
|
||||
getData(): Array<{ code: string, name: string }>;
|
||||
};
|
||||
22
types/country-list/tsconfig.json
Normal file
22
types/country-list/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"country-list-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/country-list/tslint.json
Normal file
1
types/country-list/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
31
types/delaunator/delaunator-tests.ts
Normal file
31
types/delaunator/delaunator-tests.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import * as Delaunator from 'delaunator';
|
||||
import { Points, GetPoint } from 'delaunator';
|
||||
|
||||
// Default [x, y]
|
||||
const points: Points = [[168, 180], [168, 178], [168, 179], [168, 181], [168, 183], [167, 183], [167, 184]];
|
||||
const d = new Delaunator(points);
|
||||
|
||||
// Custom getX & getY
|
||||
interface CustomPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
const customPoints = [{x: 168, y: 180}, {x: 168, y: 178}, {x: 168, y: 179}, {x: 168, y: 181}, {x: 168, y: 183}, {x: 167, y: 183}, {x: 167, y: 184}];
|
||||
|
||||
const getX = (point: CustomPoint) => point.x;
|
||||
const getY = (point: CustomPoint) => point.y;
|
||||
|
||||
new Delaunator(customPoints, point => point.x, point => point.y);
|
||||
new Delaunator(customPoints, getX, getY);
|
||||
|
||||
// To get the coordinates of all triangles, use:
|
||||
const triangles = d.triangles;
|
||||
const halfedges = d.halfedges;
|
||||
const coordinates: number[][][] = [];
|
||||
for (let i = 0; i < triangles.length; i += 3) {
|
||||
coordinates.push([
|
||||
points[triangles[i]],
|
||||
points[triangles[i + 1]],
|
||||
points[triangles[i + 2]]
|
||||
]);
|
||||
}
|
||||
35
types/delaunator/index.d.ts
vendored
Normal file
35
types/delaunator/index.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// Type definitions for delaunator 1.0
|
||||
// Project: https://github.com/mapbox/delaunator#readme
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Delaunator<T> {
|
||||
/**
|
||||
* A flat Int32Array array of triangle vertex indices (each group of three numbers forms a triangle). All triangles are directed counterclockwise.
|
||||
*/
|
||||
triangles: Int32Array;
|
||||
|
||||
/**
|
||||
* A flat Int32Array array of triangle half-edge indices that allows you to traverse the triangulation.
|
||||
* i-th half-edge in the array corresponds to vertex triangles[i] the half-edge is coming from.
|
||||
* halfedges[i] is the index of a twin half-edge in an adjacent triangle (or -1 for outer half-edges on the convex hull).
|
||||
*
|
||||
* The flat array-based data structures might be counterintuitive, but they're one of the key reasons this library is fast.
|
||||
*/
|
||||
halfedges: Int32Array;
|
||||
|
||||
/**
|
||||
* Constructs a delaunay triangulation object given an array of points ([x, y] by default). Duplicate points are skipped.
|
||||
*/
|
||||
constructor(points: Delaunator.Points);
|
||||
constructor(points: T[], getX: Delaunator.GetPoint<T>, getY: Delaunator.GetPoint<T>);
|
||||
}
|
||||
|
||||
declare namespace Delaunator {
|
||||
type Point = number[];
|
||||
type Points = Point[];
|
||||
type Triangles = Int32Array;
|
||||
type HalfEdges = Int32Array;
|
||||
type GetPoint<T> = (point: T) => number;
|
||||
}
|
||||
export = Delaunator;
|
||||
22
types/delaunator/tsconfig.json
Normal file
22
types/delaunator/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"delaunator-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/delaunator/tslint.json
Normal file
1
types/delaunator/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
197
types/devexpress-web/index.d.ts
vendored
197
types/devexpress-web/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DevExpress ASP.NET v171.3
|
||||
// Type definitions for DevExpress ASP.NET v171.4
|
||||
// Project: http://devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -2554,12 +2554,27 @@ interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventAr
|
||||
*/
|
||||
ItemName: string;
|
||||
}
|
||||
interface CardWidgetCustomizeTextEventArgs {
|
||||
getValue(): Object;
|
||||
getDefaultText(): string;
|
||||
}
|
||||
/**
|
||||
* A Card widget that visualizes a Card dashboard item's data.
|
||||
*/
|
||||
interface CardWidget {
|
||||
/**
|
||||
* Gets or sets the background color for a card.
|
||||
* Value: A string that specifies the <a href="https://www.w3schools.com/html/html_colors.asp">HTML color</a> used to paint a card's background.
|
||||
*/
|
||||
cardBackColor: string;
|
||||
onCustomizeText: Object;
|
||||
}
|
||||
/**
|
||||
* When implemented, represents the Web Dashboard extension.
|
||||
*/
|
||||
interface IExtension {
|
||||
/**
|
||||
* A unique name of a Web Dashboard extension.
|
||||
* Gets a unique name of a Web Dashboard extension.
|
||||
* Value: A string value that is a unique name of a Web Dashboard extension.
|
||||
*/
|
||||
name: string;
|
||||
@@ -2577,12 +2592,12 @@ interface IExtension {
|
||||
*/
|
||||
interface DashboardControl {
|
||||
/**
|
||||
* Gets or sets knockout templates that you can used in the Web Dashboard.
|
||||
* Value: A <see cref="KnockoutObservableArray" /> object that is a knockout template.
|
||||
* Gets or sets knockout templates that you can use in the Web Dashboard.
|
||||
* Value: A <see cref="KnockoutObservableArray" /> object that is a knockout template collection.
|
||||
*/
|
||||
customTemplates: KnockoutObservableArray;
|
||||
/**
|
||||
* Provide an access to the collection of registered dashboard extensions.
|
||||
* Provides an access to the collection of registered dashboard extensions.
|
||||
* Value: An array of IExtension objects that are dashboard extensions.
|
||||
*/
|
||||
extensions: IExtension[];
|
||||
@@ -2719,7 +2734,7 @@ interface DashboardPanelExtension extends IExtension {
|
||||
*/
|
||||
panelWidth: number;
|
||||
/**
|
||||
* Allows you to control the Dashboard Panel's visibility.
|
||||
* Gets or sets whether the Dashboard Panel is visible.
|
||||
* Value: true, to display the Dashboard Panel; otherwise, false.
|
||||
*/
|
||||
visible: KnockoutObservableBoolean;
|
||||
@@ -2739,8 +2754,8 @@ interface AvailableDataSourcesExtension extends IExtension {
|
||||
*/
|
||||
interface DashboardMenuItem {
|
||||
/**
|
||||
* Gets or sets a unique id of a dashboard menu item.
|
||||
* Value: A string value that is a menu item's unique name.
|
||||
* Gets or sets a unique identifier of a dashboard menu item.
|
||||
* Value: A string value that is a menu item's unique identifier.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
@@ -2749,13 +2764,13 @@ interface DashboardMenuItem {
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Gets or sets a position of the dashboard menu item group within the dashboard menu.
|
||||
* Gets or sets a position of the dashboard menu item within the dashboard menu.
|
||||
* Value: A zero-based integer specifying the position of the current dashboard menu item.
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* Gets or sets a keyboard shortcut used to invoke the command.
|
||||
* Value: An integer value that specifies a hotkey combination.
|
||||
* Gets or sets a code of the key used in the keyboard shortcut. This shortcut allows you to invoke the current menu item.
|
||||
* Value: An integer value that specifies a key code.
|
||||
*/
|
||||
hotKey: number;
|
||||
/**
|
||||
@@ -2774,7 +2789,7 @@ interface DashboardMenuItem {
|
||||
*/
|
||||
selected: KnockoutObservableBoolean;
|
||||
/**
|
||||
* Gets or sets whether a dashboard menu item should be disabled.
|
||||
* Gets whether a dashboard menu item is disabled.
|
||||
* Value: true, if a dashboard menu item should be disabled; otherwise, false.
|
||||
*/
|
||||
disabled: KnockoutObservableBoolean;
|
||||
@@ -2845,7 +2860,7 @@ interface DashboardToolbarItem {
|
||||
title: string;
|
||||
/**
|
||||
* Gets or sets whether a toolbar item should be disabled.
|
||||
* Value: true, if a toolbar item should be disabled; otherwise, false.
|
||||
* Value: true, if a toolbar item is disabled; otherwise, false.
|
||||
*/
|
||||
disabled: KnockoutObservableBoolean;
|
||||
/**
|
||||
@@ -3441,6 +3456,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit {
|
||||
* @param position An integer value that specifies the zero-based index of a text character that shall precede the caret.
|
||||
*/
|
||||
SetCaretPosition(position: number): void;
|
||||
/**
|
||||
* Obtains the caret position within the edited text.
|
||||
*/
|
||||
GetCaretPosition(): number;
|
||||
/**
|
||||
* Selects the specified portion of the editor's text.
|
||||
* @param startPos A zero-based integer value specifying the selection's starting position.
|
||||
@@ -5022,6 +5041,11 @@ interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingMo
|
||||
* Value: An integer value that is the toolbar index.
|
||||
*/
|
||||
toolbarIndex: number;
|
||||
/**
|
||||
* Gets the toolbar name.
|
||||
* Value: A string value that is the toolbar name.
|
||||
*/
|
||||
toolbarName: string;
|
||||
/**
|
||||
* Gets the clicked toolbar item.
|
||||
* Value: A ASPxClientMenuItem object that is the toolbar item.
|
||||
@@ -9900,7 +9924,7 @@ interface ASPxClientHtmlEditorDialogBase {
|
||||
GetCancelButton(): ASPxClientButton;
|
||||
}
|
||||
/**
|
||||
* Provides client functionality for Html Editor's dialogs operated with the elements.
|
||||
* Provides client functionality for Html Editor dialogs operated with its elements.
|
||||
*/
|
||||
interface ASPxClientHtmlEditorEditElementDialog extends ASPxClientHtmlEditorDialogBase {
|
||||
/**
|
||||
@@ -10949,7 +10973,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
changeFontBackColor: ChangeFontBackColorCommand;
|
||||
/**
|
||||
* Gets a command to reset the selected text's formatting to default.
|
||||
* Gets a command to reset text and paragraph formatting in the selected range to default.
|
||||
* Value: A <see cref="ClearFormattingCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
clearFormatting: ClearFormattingCommand;
|
||||
@@ -10979,7 +11003,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
increaseIndent: IncreaseIndentCommand;
|
||||
/**
|
||||
* Gets a command to decrement the indent level of paragraphs in a selected range.
|
||||
* Gets a command to decrease the indent level of paragraphs in a selected range.
|
||||
* Value: A <see cref="DecreaseIndentCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
decreaseIndent: DecreaseIndentCommand;
|
||||
@@ -11079,7 +11103,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openInsertTableDialog: OpenInsertTableDialogCommand;
|
||||
/**
|
||||
* Gets a command to invoke the Insert Table dialog window.
|
||||
* Gets a command to insert a rectangle table of a specified size.
|
||||
* Value: A <see cref="InsertTableCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
insertTable: InsertTableCommand;
|
||||
@@ -11089,7 +11113,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openInsertPictureDialog: OpenInsertPictureDialogCommand;
|
||||
/**
|
||||
* Gets a command to insert a picture from a file.
|
||||
* Gets a command to insert an inline picture stored by specifed web address.
|
||||
* Value: A <see cref="InsertPictureCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
insertPicture: InsertPictureCommand;
|
||||
@@ -11304,7 +11328,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openTabsDialog: OpenTabsDialogCommand;
|
||||
/**
|
||||
* Gets a command to change paragraph tab stops.
|
||||
* Gets a command to change the tab stop value of a document or selected paragraphs
|
||||
* Value: A <see cref="ChangeTabsCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
changeTabs: ChangeTabsCommand;
|
||||
@@ -11334,7 +11358,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
decrementNumberingIndent: DecrementNumberingIndentCommand;
|
||||
/**
|
||||
* Gets a command to create an empty field in the document.
|
||||
* Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed).
|
||||
* Value: A <see cref="CreateFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createField: CreateFieldCommand;
|
||||
@@ -11374,17 +11398,17 @@ interface RichEditCommands {
|
||||
*/
|
||||
updateAllFields: UpdateAllFieldsCommand;
|
||||
/**
|
||||
* Gets a command to insert a DATE field displaying the current date.
|
||||
* Gets a command to insert and update a field with a DATE code.
|
||||
* Value: A <see cref="CreateDateFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createDateField: CreateDateFieldCommand;
|
||||
/**
|
||||
* Gets a command to insert a TIME field displaying the current time.
|
||||
* Gets a command to replace the selection with a TIME field displaying the current time.
|
||||
* Value: A <see cref="CreateTimeFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createTimeField: CreateTimeFieldCommand;
|
||||
/**
|
||||
* A command to insert a PAGE field displaying the current page number.
|
||||
* A command to replace the selection with a PAGE field displaying the current page number.
|
||||
* Value: A <see cref="CreatePageFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createPageField: CreatePageFieldCommand;
|
||||
@@ -11434,7 +11458,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
mergeFieldDialog: MergeFieldDialogCommand;
|
||||
/**
|
||||
* Gets a command to insert a MERGEFIELD field (with a data source column name) at the current position in the document.
|
||||
* Gets a command to replace the selection with a MERGEFIELD (a data source column name is passed with a parameter).
|
||||
* Value: A <see cref="CreateMergeFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createMergeField: CreateMergeFieldCommand;
|
||||
@@ -11504,7 +11528,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
closeHeaderFooter: CloseHeaderFooterCommand;
|
||||
/**
|
||||
* Gets a command to insert a NUMPAGES field displaying the total number of pages.
|
||||
* Gets a command to replace the selection with a NUMPAGES field displaying the total number of pages.
|
||||
* Value: A <see cref="CreatePageCountFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createPageCountField: CreatePageCountFieldCommand;
|
||||
@@ -11863,6 +11887,7 @@ interface RichEditCommands {
|
||||
* Value: A <see cref="ChangeTextBoxContentMarginsCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand;
|
||||
changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand;
|
||||
}
|
||||
/**
|
||||
* Serves as a base for objects that implement different client command functionalities.
|
||||
@@ -12762,9 +12787,9 @@ interface OpenInsertBookmarkDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertBookmarkCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param name A string value specifying name of creating bookmark.
|
||||
* @param start An integer value specifying the start position of bookmark's range.
|
||||
* @param length An integer value specifying the length of bookmark's range.
|
||||
* @param name A string value specifying a name of the created bookmark.
|
||||
* @param start An integer value specifying the start position of the bookmark's range.
|
||||
* @param length An integer value specifying the length of the bookmark's range.
|
||||
*/
|
||||
execute(name: string, start: number, length: number): boolean;
|
||||
}
|
||||
@@ -12774,7 +12799,7 @@ interface InsertBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
interface DeleteBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the DeleteBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param name A string value specifying name of the deleted bookmark.
|
||||
* @param name A string value specifying a name of the deleted bookmark.
|
||||
*/
|
||||
execute(name: string): boolean;
|
||||
}
|
||||
@@ -13233,8 +13258,8 @@ interface HideFindResultsCommand extends CommandWithSimpleStateBase {
|
||||
interface ReplaceAllCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param text A string value specifying text to replace.
|
||||
* @param replaceText A string value specifying replacing text.
|
||||
* @param text A string value specifying a text to replace.
|
||||
* @param replaceText A string value specifying the replacing text.
|
||||
* @param matchCase true, to perform a case-sensitive search; otherwise, false.
|
||||
*/
|
||||
execute(text: string, replaceText: string, matchCase: boolean): boolean;
|
||||
@@ -13448,6 +13473,10 @@ interface ChangeTextBoxContentMarginsCommand extends CommandBase {
|
||||
*/
|
||||
getState(): any;
|
||||
}
|
||||
interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase {
|
||||
execute(resizeShapeToFitText: boolean): boolean;
|
||||
getState(): any;
|
||||
}
|
||||
/**
|
||||
* Contains alignment position settings for floating objects.
|
||||
*/
|
||||
@@ -13919,7 +13948,7 @@ interface InsertNumerationCommand extends CommandWithSimpleStateBase {
|
||||
execute(abstractNumberingListIndex: number): boolean;
|
||||
/**
|
||||
* Executes the InsertNumerationCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param numberingListIndex An integer value specifying index of numbering list.
|
||||
* @param numberingListIndex An integer value specifying an index of the numbering list.
|
||||
* @param isAbstractNumberingList true, to insert an abstract numbering list; otherwise, false.
|
||||
*/
|
||||
execute(numberingListIndex: number, isAbstractNumberingList: boolean): boolean;
|
||||
@@ -14105,7 +14134,7 @@ interface InsertSymbolCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertSymbolCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param symbol A string value specifying symbols to insert.
|
||||
* @param fontName A string value specifying font of symbols to insert.
|
||||
* @param fontName A string value specifying the font of symbols to insert.
|
||||
*/
|
||||
execute(symbol: string, fontName: string): boolean;
|
||||
}
|
||||
@@ -14124,7 +14153,7 @@ interface InsertParagraphCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertTextCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param text A string value specifying text to insert.
|
||||
* @param text A string value specifying a text to insert.
|
||||
*/
|
||||
execute(text: string): boolean;
|
||||
}
|
||||
@@ -14217,7 +14246,15 @@ interface InsertTabCommand extends CommandWithSimpleStateBase {
|
||||
* Defines the scaling settings.
|
||||
*/
|
||||
interface Scale {
|
||||
/**
|
||||
* Gets or sets the image's y-scale factor as a percent.
|
||||
* Value: An integer value that is the y-scale factor as a percent.
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* Gets or sets the image's x-scale factor as a percent.
|
||||
* Value: An integer value that is the x-scale factor as a percent.
|
||||
*/
|
||||
y: number;
|
||||
}
|
||||
/**
|
||||
@@ -14346,7 +14383,7 @@ interface ChangeSectionColumnsCommand extends CommandBase {
|
||||
interface ChangePageColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying background color of the page. May be specified as color name or hex color value.
|
||||
* @param color A string specifying a background color the page. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -14427,7 +14464,7 @@ interface SetDifferentFirstPageHeaderFooterCommand extends CommandWithBooleanSta
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetDifferentFirstPageHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param differentFirstPage true to apply different text for first page's header and footer, false to remove difference.
|
||||
* @param differentFirstPage true to apply a different text for the first page's header and footer, false to remove the difference.
|
||||
*/
|
||||
execute(differentFirstPage: boolean): boolean;
|
||||
}
|
||||
@@ -14441,7 +14478,7 @@ interface SetDifferentOddAndEvenPagesHeaderFooterCommand extends CommandWithBool
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param differentOddAndEvenPages true to apply different text for odd and even pages' header and footer, false to remove difference.
|
||||
* @param differentOddAndEvenPages true to apply a different text for the header and footer of the odd and even pages , false to remove the difference.
|
||||
*/
|
||||
execute(differentOddAndEvenPages: boolean): boolean;
|
||||
}
|
||||
@@ -14650,7 +14687,7 @@ interface RemoveSpacingAfterParagraphCommand extends CommandWithSimpleStateBase
|
||||
interface ChangeParagraphBackColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeParagraphBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying highlighting color of the paragraphs in a selected range. May be specified as color name or hex color value.
|
||||
* @param color A string specifying a background color of the paragraphs in a selected range. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -14906,8 +14943,8 @@ interface OpenInsertTableDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertTableCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertTableCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param columnCount An integer value specifying number of columns in a generated table.
|
||||
* @param rowCount An integer value specifying number of rows in a generated table.
|
||||
* @param columnCount An integer value specifying a number of columns in a generated table.
|
||||
* @param rowCount An integer value specifying a number of rows in a generated table.
|
||||
*/
|
||||
execute(columnCount: number, rowCount: number): boolean;
|
||||
}
|
||||
@@ -15122,9 +15159,9 @@ interface SplitTableCellsDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface SplitTableCellsCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the SplitTableCellsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param rowCount An integer value specifying number of rows in the splitted table cells.
|
||||
* @param columnCount An integer value specifying number of columns in the splitted table cells.
|
||||
* @param mergeBeforeSplit true to merge the selected cells before splitting; otherwise, false.
|
||||
* @param rowCount An integer value specifying a number of rows in the split table cells.
|
||||
* @param columnCount An integer value specifying a number of columns in the split table cells.
|
||||
* @param mergeBeforeSplit true to merge the selected cells before the splitting; otherwise, false.
|
||||
*/
|
||||
execute(rowCount: number, columnCount: number, mergeBeforeSplit: boolean): boolean;
|
||||
}
|
||||
@@ -15385,7 +15422,7 @@ interface ChangeTableBorderRepositoryItemCommand extends CommandBase {
|
||||
interface ChangeTableCellShadingCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeTableCellShadingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying color of the selected cells' shading. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the color of the selected cells' shading. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -15856,7 +15893,7 @@ declare enum TableWidthUnitType {
|
||||
interface ChangeFontNameCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontNameCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fontName A string specifying font name.
|
||||
* @param fontName A string specifying the font name.
|
||||
*/
|
||||
execute(fontName: string): boolean;
|
||||
/**
|
||||
@@ -15870,7 +15907,7 @@ interface ChangeFontNameCommand extends CommandBase {
|
||||
interface ChangeFontSizeCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fontSize An integer number specifying font size.
|
||||
* @param fontSize An integer number specifying the font size.
|
||||
*/
|
||||
execute(fontSize: number): boolean;
|
||||
/**
|
||||
@@ -16022,7 +16059,7 @@ interface ChangeFontSubscriptCommand extends CommandWithBooleanStateBase {
|
||||
interface ChangeFontForeColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontForeColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying font color. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the font color. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -16036,7 +16073,7 @@ interface ChangeFontForeColorCommand extends CommandBase {
|
||||
interface ChangeFontBackColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying highlighting color. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the background font color. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -16064,8 +16101,8 @@ interface ChangeStyleCommand extends CommandBase {
|
||||
execute(style: StyleBase): boolean;
|
||||
/**
|
||||
* Executes the ChangeStyleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param styleName A string specifying the name of applying style.
|
||||
* @param isParagraphStyle true to apply style to paragraph, false to apply style to character.
|
||||
* @param styleName A string specifying the applying style's name.
|
||||
* @param isParagraphStyle true to apply the style to a paragraph, false to apply the style to a character.
|
||||
*/
|
||||
execute(styleName: string, isParagraphStyle: boolean): boolean;
|
||||
/**
|
||||
@@ -16213,7 +16250,7 @@ interface SetFullscreenCommand extends CommandWithBooleanStateBase {
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetFullscreenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fullscreen true to apply fullscreen mode, false to remove fullscreen mode.
|
||||
* @param fullscreen true to apply the fullscreen mode, false to disable the fullscreen mode.
|
||||
*/
|
||||
execute(fullscreen: boolean): boolean;
|
||||
}
|
||||
@@ -17101,7 +17138,7 @@ interface ASPxClientScheduler extends ASPxClientControl {
|
||||
*/
|
||||
ActiveViewChanged: ASPxClientEvent<ASPxClientEventHandler<ASPxClientScheduler>>;
|
||||
/**
|
||||
* Occurs when an end-user pressers a keyboard shortcut.
|
||||
* Occurs when an end-user presses a keyboard shortcut.
|
||||
*/
|
||||
Shortcut: ASPxClientEvent<ShortcutEventHandler<ASPxClientScheduler>>;
|
||||
/**
|
||||
@@ -17926,8 +17963,8 @@ interface ASPxClientToolTipBase {
|
||||
*/
|
||||
Close(): void;
|
||||
/**
|
||||
*
|
||||
* @param bounds
|
||||
* Gets the tooltip position.
|
||||
* @param bounds An object that represents the tooltip bounds.
|
||||
*/
|
||||
CalculatePosition(bounds: Object): ASPxClientPoint;
|
||||
/**
|
||||
@@ -19184,6 +19221,11 @@ interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessi
|
||||
* Value: An integer value that is the toolbar index.
|
||||
*/
|
||||
toolbarIndex: number;
|
||||
/**
|
||||
* Gets the toolbar name.
|
||||
* Value: A string object that is the toolbar name.
|
||||
*/
|
||||
toolbarName: string;
|
||||
/**
|
||||
* Gets the toolbar item related to the event.
|
||||
* Value: An ASPxClientMenuItem object that is the toolbar item.
|
||||
@@ -19526,11 +19568,6 @@ interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit {
|
||||
*/
|
||||
interface BootstrapClientFormLayout extends ASPxClientFormLayout {
|
||||
}
|
||||
/**
|
||||
* Represents a client-side equivalent of the BootstrapGridView control.
|
||||
*/
|
||||
interface BootstrapClientGridView extends ASPxClientGridView {
|
||||
}
|
||||
/**
|
||||
* Represents a client-side equivalent of the BootstrapHyperLink control.
|
||||
*/
|
||||
@@ -19795,6 +19832,8 @@ interface BootstrapUIWidgetBase extends ASPxClientControl {
|
||||
IncidentOccurred: ASPxClientEvent<BootstrapUIWidgetErrorEventHandler<BootstrapUIWidgetBase>>;
|
||||
GetInstance(): Object;
|
||||
SetOptions(options: Object): void;
|
||||
SetDataSource(dataSource: Object): void;
|
||||
GetDataSource(): Object;
|
||||
ExportTo(format: string, fileName: string): void;
|
||||
Print(): void;
|
||||
}
|
||||
@@ -19848,6 +19887,8 @@ interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElemen
|
||||
*/
|
||||
interface BootstrapClientUploadControl extends ASPxClientUploadControl {
|
||||
}
|
||||
interface BootstrapClientGridView extends ASPxClientGridView {
|
||||
}
|
||||
/**
|
||||
* A client-side counterpart of the Calendar and CalendarFor extensions.
|
||||
*/
|
||||
@@ -20489,6 +20530,9 @@ interface MVCxClientRoundPanel extends ASPxClientRoundPanel {
|
||||
* A client-side counterpart of the Scheduler extension.
|
||||
*/
|
||||
interface MVCxClientScheduler extends ASPxClientScheduler {
|
||||
/**
|
||||
* Occurs on the client side when the tooltip is about to be displayed.
|
||||
*/
|
||||
ToolTipDisplaying: ASPxClientEvent<MVCxClientSchedulerToolTipDisplayingEventHandler<MVCxClientScheduler>>;
|
||||
/**
|
||||
* Occurs when a callback for server-side processing is initiated.
|
||||
@@ -20515,6 +20559,10 @@ interface MVCxClientScheduler extends ASPxClientScheduler {
|
||||
* A template that is rendered to display a tooltip.
|
||||
*/
|
||||
interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase {
|
||||
/**
|
||||
* Gets the tooltip type.
|
||||
* Value: A MVCxSchedulerToolTipType object that specifies the tooltip type.
|
||||
*/
|
||||
type: MVCxSchedulerToolTipType;
|
||||
}
|
||||
/**
|
||||
@@ -20532,7 +20580,15 @@ interface MVCxClientSchedulerToolTipDisplayingEventHandler<S> {
|
||||
* Provides data for the ToolTipDisplaying event.
|
||||
*/
|
||||
interface MVCxClientSchedulerToolTipDisplayingEventArgs extends ASPxClientEventArgs {
|
||||
/**
|
||||
* Gets the tooltip related to the event.
|
||||
* Value: A MVCxClientSchedulerTemplateToolTip object that specifies the tooltip.
|
||||
*/
|
||||
toolTip: MVCxClientSchedulerTemplateToolTip;
|
||||
/**
|
||||
* Gets information about the tooltip related to the event.
|
||||
* Value: A ASPxClientSchedulerToolTipData object that specifies information about the tooltip.
|
||||
*/
|
||||
data: ASPxClientSchedulerToolTipData;
|
||||
}
|
||||
/**
|
||||
@@ -23396,6 +23452,11 @@ interface ASPxClientHintShowingEventArgs extends ASPxClientEventArgs {
|
||||
* Value: An object representing the hint's title element related to the event.
|
||||
*/
|
||||
titleElement: Object;
|
||||
/**
|
||||
* Gets or sets a value indicating whether the event should be canceled.
|
||||
* Value: true, if the event should be canceled; otherwise, false.
|
||||
*/
|
||||
cancel: boolean;
|
||||
}
|
||||
/**
|
||||
* A method that will handle the Hiding event.
|
||||
@@ -32198,8 +32259,6 @@ interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic
|
||||
}
|
||||
interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic {
|
||||
}
|
||||
interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic {
|
||||
}
|
||||
interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic {
|
||||
}
|
||||
interface BootstrapClientImageStatic extends ASPxClientImageStatic {
|
||||
@@ -32238,6 +32297,8 @@ interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic {
|
||||
}
|
||||
interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic {
|
||||
}
|
||||
interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic {
|
||||
}
|
||||
interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic {
|
||||
/**
|
||||
* Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress.
|
||||
@@ -32702,15 +32763,15 @@ interface ASPxClientHintStatic extends ASPxClientControlStatic {
|
||||
*/
|
||||
Register(targetSelector: string, options: ASPxClientHintOptions): ASPxClientHint;
|
||||
/**
|
||||
*
|
||||
* @param targetSelector
|
||||
* @param contentAttribute
|
||||
* Registers a hint's functionality with the specified settings.
|
||||
* @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed.
|
||||
* @param contentAttribute A string value that is the attribute name. Specifies from which target element's attribute a hint obtains its content.
|
||||
*/
|
||||
Register(targetSelector: string, contentAttribute: string): ASPxClientHint;
|
||||
/**
|
||||
*
|
||||
* @param targetSelector
|
||||
* @param onShowing
|
||||
* Registers a hint's functionality with the specified settings.
|
||||
* @param targetSelector A string value that is the CSS selector. Specifies for which UI elements the hint is displayed.
|
||||
* @param onShowing An ASPxClientHintShowingEventHandler object that is a handler for the displayed event.
|
||||
*/
|
||||
Register(targetSelector: string, onShowing: ASPxClientHintShowingEventHandler): ASPxClientHint;
|
||||
/**
|
||||
@@ -33521,7 +33582,6 @@ declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic;
|
||||
declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic;
|
||||
declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic;
|
||||
declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic;
|
||||
declare var BootstrapClientGridView: BootstrapClientGridViewStatic;
|
||||
declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic;
|
||||
declare var BootstrapClientImage: BootstrapClientImageStatic;
|
||||
declare var BootstrapClientListBox: BootstrapClientListBoxStatic;
|
||||
@@ -33541,6 +33601,7 @@ declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic;
|
||||
declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic;
|
||||
declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic;
|
||||
declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic;
|
||||
declare var BootstrapClientGridView: BootstrapClientGridViewStatic;
|
||||
declare var MVCxClientCalendar: MVCxClientCalendarStatic;
|
||||
declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic;
|
||||
declare var MVCxClientCardView: MVCxClientCardViewStatic;
|
||||
|
||||
22
types/devexpress-web/v162/index.d.ts
vendored
22
types/devexpress-web/v162/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DevExpress ASP.NET v162.7
|
||||
// Type definitions for DevExpress ASP.NET v162.8
|
||||
// Project: http://devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -2409,6 +2409,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit {
|
||||
* @param position An integer value that specifies the zero-based index of a text character that shall precede the caret.
|
||||
*/
|
||||
SetCaretPosition(position: number): void;
|
||||
/**
|
||||
* Obtains the caret position within the edited text.
|
||||
*/
|
||||
GetCaretPosition(): number;
|
||||
/**
|
||||
* Selects the specified portion of the editor's text.
|
||||
* @param startPos A zero-based integer value specifying the selection's starting position.
|
||||
@@ -7822,8 +7826,20 @@ interface ASPxClientHtmlEditorCommandStyleSettings {
|
||||
* Value: A string that specifies an element's left margin <a href="http://www.w3schools.com/cssref/pr_margin.asp">in any correct format</a>.
|
||||
*/
|
||||
marginLeft: string;
|
||||
/**
|
||||
* Gets or sets a media element's background color.
|
||||
* Value: A string that specifies a background color <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Gets or sets the element's text alignment.
|
||||
* Value: A string value that specifies the element's text alignment <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
textAlign: string;
|
||||
/**
|
||||
* Gets or sets the element's vertical alignment.
|
||||
* Value: A string value that specifies the element's vertical alignment <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
verticalAlign: string;
|
||||
}
|
||||
/**
|
||||
@@ -7895,6 +7911,10 @@ interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlE
|
||||
* Value: A string value defining the title of the target link.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Contains the style settings defining the appearance of the target link element.
|
||||
* Value: An <see cref="ASPxClientHtmlEditorCommandStyleSettings" /> object that contains the style settings defining the appearance of the target link element.
|
||||
*/
|
||||
styleSettings: ASPxClientHtmlEditorCommandStyleSettings;
|
||||
}
|
||||
/**
|
||||
|
||||
10
types/dom-inputevent/dom-inputevent-tests.ts
Normal file
10
types/dom-inputevent/dom-inputevent-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
const input = document.createElement('input');
|
||||
input.addEventListener('input', (event: InputEvent) => {
|
||||
return event.data === 'foo' && event.isComposing === true;
|
||||
});
|
||||
|
||||
const foo = new InputEvent('input');
|
||||
const bar = new InputEvent('beforeinput', {
|
||||
data: 'bar',
|
||||
isComposing: true,
|
||||
});
|
||||
17
types/dom-inputevent/index.d.ts
vendored
Normal file
17
types/dom-inputevent/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for UI Events W3C Working Draft — Input Events — Interface InputEvent 1.0
|
||||
// Project: https://w3c.github.io/uievents/#interface-inputevent
|
||||
// Definitions by: Steven Sinatra <https://github.com/diagramatics>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface InputEventInit extends UIEventInit {
|
||||
data?: string;
|
||||
isComposing: boolean;
|
||||
}
|
||||
interface InputEvent extends UIEvent {
|
||||
readonly data: string;
|
||||
readonly isComposing: boolean;
|
||||
}
|
||||
|
||||
declare class InputEvent {
|
||||
constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit);
|
||||
}
|
||||
23
types/dom-inputevent/tsconfig.json
Normal file
23
types/dom-inputevent/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dom-inputevent-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/dom-inputevent/tslint.json
Normal file
1
types/dom-inputevent/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
46
types/draggabilly/draggabilly-tests.ts
Normal file
46
types/draggabilly/draggabilly-tests.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import Draggabilly from 'draggabilly';
|
||||
|
||||
const elem = document.querySelector('.draggable') as Element;
|
||||
|
||||
const draggieA = new Draggabilly('.test');
|
||||
const draggieB = new Draggabilly(elem);
|
||||
|
||||
const draggie = new Draggabilly(elem, {
|
||||
axis: 'x',
|
||||
containment: true,
|
||||
grid: [20, 20],
|
||||
handle: '.handle'
|
||||
});
|
||||
|
||||
const draggiePosX: number = draggie.position.x;
|
||||
const draggiePosY: number = draggie.position.y;
|
||||
|
||||
draggie.on( 'dragMove', (event, pointer, moveVector) => {
|
||||
const pointerPageX: number = pointer.pageX;
|
||||
const pointePageY: number = pointer.pageY;
|
||||
|
||||
const moveVectorX: number = moveVector.x;
|
||||
const moveVectorY: number = moveVector.y;
|
||||
});
|
||||
|
||||
draggie.on( 'dragStart', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'dragEnd', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'pointerDown', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'pointerMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.on( 'pointerUp', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'staticClick', (event, pointer) => {});
|
||||
|
||||
draggie.off('dragMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.once('dragMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.enable();
|
||||
|
||||
draggie.disable();
|
||||
|
||||
draggie.destroy();
|
||||
45
types/draggabilly/index.d.ts
vendored
Normal file
45
types/draggabilly/index.d.ts
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// Type definitions for draggabilly 2.1
|
||||
// Project: http://draggabilly.desandro.com/
|
||||
// Definitions by: Jason Wu <https://github.com/jaydubu/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface DraggabillyOptions {
|
||||
axis?: 'x' | 'y';
|
||||
containment?: Element | string | boolean;
|
||||
grid?: [number, number];
|
||||
handle?: string;
|
||||
}
|
||||
|
||||
export type DraggabillyClickEventName = 'dragStart' | 'dragEnd' | 'pointerDown' | 'pointerUp' | 'staticClick';
|
||||
|
||||
export type DraggabillyMoveEventName = 'dragMove' | 'pointerMove';
|
||||
|
||||
export default class Draggabilly {
|
||||
position: Position;
|
||||
|
||||
constructor(element: Element | string, options?: DraggabillyOptions);
|
||||
|
||||
on(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
on(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
off(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
off(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
once(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
once(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
enable(): void;
|
||||
|
||||
disable(): void;
|
||||
|
||||
destroy(): void;
|
||||
}
|
||||
23
types/draggabilly/tsconfig.json
Normal file
23
types/draggabilly/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"draggabilly-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/draggabilly/tslint.json
Normal file
1
types/draggabilly/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,9 +1,13 @@
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function (name:string):string {
|
||||
return name + 'new';
|
||||
const dropzoneRenameFunction = function (name: string): string {
|
||||
return name + 'new';
|
||||
};
|
||||
|
||||
Dropzone.createElement('<div id="divTest"></div>');
|
||||
Dropzone.isBrowserSupported();
|
||||
console.log(Dropzone.instances.length);
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
method: "post",
|
||||
@@ -14,8 +18,14 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
paramName: "file",
|
||||
createImageThumbnails: true,
|
||||
maxThumbnailFilesize: 1024,
|
||||
thumbnailWidth: 50,
|
||||
thumbnailHeight: 50,
|
||||
thumbnailWidth: 120,
|
||||
thumbnailHeight: 120,
|
||||
thumbnailMethod: 'crop',
|
||||
resizeWidth: 1024,
|
||||
resizeHeight: 1024,
|
||||
resizeMimeType: 'image.jpeg',
|
||||
resizeQuality: .8,
|
||||
resizeMethod: 'contain',
|
||||
filesizeBase: 1000,
|
||||
maxFiles: 100,
|
||||
params: {
|
||||
@@ -47,7 +57,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
dictRemoveFileConfirmation: "",
|
||||
dictMaxFilesExceeded: "",
|
||||
|
||||
accept: (file:Dropzone.DropzoneFile, done:(error?:string|Error) => void) => {
|
||||
accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => {
|
||||
if (file.accepted) {
|
||||
file.previewElement.classList.add("accepted");
|
||||
file.previewTemplate.classList.add("accepted");
|
||||
@@ -61,7 +71,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
init: () => console.log("Initialized"),
|
||||
forceFallback: false,
|
||||
fallback: () => console.log("Fallback"),
|
||||
resize: (file:Dropzone.DropzoneFile) => ({
|
||||
resize: (file: Dropzone.DropzoneFile, width: 120, height: 120, resizeMethod: 'contain') => ({
|
||||
srcX: 0,
|
||||
srcY: 0,
|
||||
trgX: 10,
|
||||
@@ -70,54 +80,52 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
srcHeight: 100,
|
||||
trgWidth: 50,
|
||||
trgHeight: 50,
|
||||
optWidth: 50,
|
||||
optHeight: 50
|
||||
}),
|
||||
|
||||
drop: (e:DragEvent) => console.log("Drop"),
|
||||
dragstart: (e:DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e:DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e:DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e:DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e:DragEvent) => console.log("Dragleave"),
|
||||
paste: (e:DragEvent) => console.log("Paste"),
|
||||
drop: (e: DragEvent) => console.log("Drop"),
|
||||
dragstart: (e: DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e: DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e: DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e: DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e: DragEvent) => console.log("Dragleave"),
|
||||
paste: (e: DragEvent) => console.log("Paste"),
|
||||
|
||||
reset: () => console.log("Reset"),
|
||||
|
||||
addedfile: (file:Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files:Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file:Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file:Dropzone.DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
|
||||
addedfile: (file: Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files: Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file: Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file: Dropzone.DropzoneFile, dataUrl: string) => console.log("Thumbnail"),
|
||||
|
||||
error: (file:Dropzone.DropzoneFile, message:string|Error) => console.log("Error"),
|
||||
errormultiple: (files:Dropzone.DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
|
||||
error: (file: Dropzone.DropzoneFile, message: string | Error) => console.log("Error"),
|
||||
errormultiple: (files: Dropzone.DropzoneFile[], message: string | Error) => console.log("Errormultiple"),
|
||||
|
||||
processing: (file:Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
processing: (file: Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files: Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
|
||||
uploadprogress: (file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
|
||||
uploadprogress: (file: Dropzone.DropzoneFile, progress: number, bytesSent: number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress: number, totalBytes: number, totalBytesSent: number) => console.log("Totaluploadprogress"),
|
||||
|
||||
sending: (file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
|
||||
sendingmultiple: (files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
|
||||
sending: (file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: {}) => console.log("Sending"),
|
||||
sendingmultiple: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: {}) => console.log("Sendingmultiple"),
|
||||
|
||||
success: (file:Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
success: (file: Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files: Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
|
||||
canceled: (file:Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file:Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
canceled: (file: Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file: Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
|
||||
complete: (file:Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file:Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
complete: (file: Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file: Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
|
||||
maxfilesexceeded: (file:Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files:Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
maxfilesexceeded: (file: Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files: Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
queuecomplete: () => console.log("Queuecomplete"),
|
||||
|
||||
previewTemplate: "<div></div>",
|
||||
});
|
||||
|
||||
var dropzoneWithOptionsVariations:Dropzone;
|
||||
var dropzoneWithOptionsVariations: Dropzone;
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ".test"
|
||||
});
|
||||
@@ -135,10 +143,10 @@ dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
});
|
||||
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:Object) => console.log(file, response)
|
||||
success: (file: Dropzone.DropzoneFile, response: Object) => console.log(file, response)
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:string) => console.log(file, response)
|
||||
success: (file: Dropzone.DropzoneFile, response: string) => console.log(file, response)
|
||||
});
|
||||
|
||||
const dropzone = new Dropzone(".test");
|
||||
@@ -167,19 +175,34 @@ dropzone.enqueueFile(firstFile);
|
||||
dropzone.processFile(firstFile);
|
||||
dropzone.uploadFile(firstFile);
|
||||
dropzone.cancelUpload(firstFile);
|
||||
dropzone.createThumbnail(firstFile, () => {
|
||||
|
||||
dropzone.createThumbnail(firstFile);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true, () => {
|
||||
console.log("createThumbnail")
|
||||
});
|
||||
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
|
||||
|
||||
dropzone.createThumbnailFromUrl(firstFile);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true, () => {
|
||||
console.log("createThumbnailFromUrl")
|
||||
});
|
||||
dropzone.accept(firstFile, (e:string|Error) => {
|
||||
dropzone.accept(firstFile, (e: string | Error) => {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
const acceptedFiles = dropzone.getAcceptedFiles();
|
||||
dropzone.processFiles(acceptedFiles);
|
||||
|
||||
const addedFiles = dropzone.getAddedFiles();
|
||||
dropzone.processFiles(addedFiles);
|
||||
|
||||
const rejectedFiles = dropzone.getRejectedFiles();
|
||||
dropzone.enqueueFiles(rejectedFiles);
|
||||
|
||||
@@ -192,12 +215,18 @@ dropzone.processFiles(uploadingFiles);
|
||||
const activeFiles = dropzone.getActiveFiles();
|
||||
dropzone.processFiles(activeFiles);
|
||||
|
||||
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(addedFiles);
|
||||
const getFileWithStatusAdded = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(getFileWithStatusAdded);
|
||||
|
||||
dropzone.processQueue();
|
||||
dropzone.removeAllFiles(true);
|
||||
|
||||
dropzone.resizeImage(firstFile);
|
||||
dropzone.resizeImage(firstFile, 120);
|
||||
dropzone.resizeImage(firstFile, 120, 120);
|
||||
dropzone.resizeImage(firstFile, 120, 120, 'contain');
|
||||
dropzone.resizeImage(firstFile, 120, 120, 'contain', function () { });
|
||||
|
||||
dropzone
|
||||
.on("drop", () => {
|
||||
console.count('drop');
|
||||
@@ -287,9 +316,9 @@ dropzone
|
||||
console.count('queuecomplete');
|
||||
});
|
||||
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.off("dragstart")
|
||||
.off();
|
||||
|
||||
|
||||
310
types/dropzone/index.d.ts
vendored
310
types/dropzone/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Dropzone 4.3.0
|
||||
// Type definitions for Dropzone 5.0.0
|
||||
// Project: http://www.dropzonejs.com/
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>, Ted Bicknell <https://github.com/tedbcsgpro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
|
||||
declare namespace Dropzone {
|
||||
export interface DropzoneResizeInfo {
|
||||
srcX?:number;
|
||||
srcY?:number;
|
||||
trgX?:number;
|
||||
trgY?:number;
|
||||
srcWidth?:number;
|
||||
srcHeight?:number;
|
||||
trgWidth?:number;
|
||||
trgHeight?:number;
|
||||
optWidth?:number;
|
||||
optHeight?:number;
|
||||
srcX?: number;
|
||||
srcY?: number;
|
||||
trgX?: number;
|
||||
trgY?: number;
|
||||
srcWidth?: number;
|
||||
srcHeight?: number;
|
||||
trgWidth?: number;
|
||||
trgHeight?: number;
|
||||
}
|
||||
|
||||
export interface DropzoneFile extends File {
|
||||
@@ -41,18 +39,24 @@ declare namespace Dropzone {
|
||||
maxThumbnailFilesize?: number;
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
thumbnailMethod?: string;
|
||||
resizeWidth?: number;
|
||||
resizeHeight?: number;
|
||||
resizeMimeType?: string;
|
||||
resizeQuality?: number;
|
||||
resizeMethod?: string;
|
||||
filesizeBase?: number;
|
||||
maxFiles?: number;
|
||||
params?: {};
|
||||
headers?: {};
|
||||
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
|
||||
clickable?: boolean | string | HTMLElement | (string | HTMLElement)[];
|
||||
ignoreHiddenFiles?: boolean;
|
||||
acceptedFiles?: string;
|
||||
renameFilename?(name:string): string;
|
||||
renameFilename?(name: string): string;
|
||||
autoProcessQueue?: boolean;
|
||||
autoQueue?: boolean;
|
||||
addRemoveLinks?: boolean;
|
||||
previewsContainer?: boolean|string|HTMLElement;
|
||||
previewsContainer?: boolean | string | HTMLElement;
|
||||
hiddenInputContainer?: HTMLElement;
|
||||
capture?: string;
|
||||
|
||||
@@ -68,209 +72,225 @@ declare namespace Dropzone {
|
||||
dictRemoveFileConfirmation?: string;
|
||||
dictMaxFilesExceeded?: string;
|
||||
|
||||
accept?(file:DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
init?():void;
|
||||
accept?(file: DropzoneFile, done: (error?: string | Error) => void): void;
|
||||
init?(): void;
|
||||
forceFallback?: boolean;
|
||||
fallback?():void;
|
||||
resize?(file:DropzoneFile):DropzoneResizeInfo;
|
||||
fallback?(): void;
|
||||
resize?(file: DropzoneFile, width?: number, height?: number, resizeMethod?: string): DropzoneResizeInfo;
|
||||
|
||||
drop?(e:DragEvent):void;
|
||||
dragstart?(e:DragEvent):void;
|
||||
dragend?(e:DragEvent):void;
|
||||
dragenter?(e:DragEvent):void;
|
||||
dragover?(e:DragEvent):void;
|
||||
dragleave?(e:DragEvent):void;
|
||||
paste?(e:DragEvent):void;
|
||||
drop?(e: DragEvent): void;
|
||||
dragstart?(e: DragEvent): void;
|
||||
dragend?(e: DragEvent): void;
|
||||
dragenter?(e: DragEvent): void;
|
||||
dragover?(e: DragEvent): void;
|
||||
dragleave?(e: DragEvent): void;
|
||||
paste?(e: DragEvent): void;
|
||||
|
||||
reset?():void;
|
||||
reset?(): void;
|
||||
|
||||
addedfile?(file:DropzoneFile):void;
|
||||
addedfiles?(files:DropzoneFile[]):void;
|
||||
removedfile?(file:DropzoneFile):void;
|
||||
thumbnail?(file:DropzoneFile, dataUrl:string):void;
|
||||
addedfile?(file: DropzoneFile): void;
|
||||
addedfiles?(files: DropzoneFile[]): void;
|
||||
removedfile?(file: DropzoneFile): void;
|
||||
thumbnail?(file: DropzoneFile, dataUrl: string): void;
|
||||
|
||||
error?(file:DropzoneFile, message:string|Error, xhr:XMLHttpRequest):void;
|
||||
errormultiple?(files:DropzoneFile[], message:string|Error, xhr:XMLHttpRequest):void;
|
||||
error?(file: DropzoneFile, message: string | Error, xhr: XMLHttpRequest): void;
|
||||
errormultiple?(files: DropzoneFile[], message: string | Error, xhr: XMLHttpRequest): void;
|
||||
|
||||
processing?(file:DropzoneFile):void;
|
||||
processingmultiple?(files:DropzoneFile[]):void;
|
||||
processing?(file: DropzoneFile): void;
|
||||
processingmultiple?(files: DropzoneFile[]): void;
|
||||
|
||||
uploadprogress?(file:DropzoneFile, progress:number, bytesSent:number):void;
|
||||
totaluploadprogress?(totalProgress:number, totalBytes:number, totalBytesSent:number):void;
|
||||
uploadprogress?(file: DropzoneFile, progress: number, bytesSent: number): void;
|
||||
totaluploadprogress?(totalProgress: number, totalBytes: number, totalBytesSent: number): void;
|
||||
|
||||
sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sending?(file: DropzoneFile, xhr: XMLHttpRequest, formData: FormData): void;
|
||||
sendingmultiple?(files: DropzoneFile[], xhr: XMLHttpRequest, formData: FormData): void;
|
||||
|
||||
success?(file: DropzoneFile, response: Object|string): void;
|
||||
successmultiple?(files:DropzoneFile[], responseText:string):void;
|
||||
success?(file: DropzoneFile, response: Object | string): void;
|
||||
successmultiple?(files: DropzoneFile[], responseText: string): void;
|
||||
|
||||
canceled?(file:DropzoneFile):void;
|
||||
canceledmultiple?(file:DropzoneFile[]):void;
|
||||
canceled?(file: DropzoneFile): void;
|
||||
canceledmultiple?(file: DropzoneFile[]): void;
|
||||
|
||||
complete?(file:DropzoneFile):void;
|
||||
completemultiple?(file:DropzoneFile[]):void;
|
||||
complete?(file: DropzoneFile): void;
|
||||
completemultiple?(file: DropzoneFile[]): void;
|
||||
|
||||
maxfilesexceeded?(file:DropzoneFile):void;
|
||||
maxfilesreached?(files:DropzoneFile[]):void;
|
||||
queuecomplete?():void;
|
||||
maxfilesexceeded?(file: DropzoneFile): void;
|
||||
maxfilesreached?(files: DropzoneFile[]): void;
|
||||
queuecomplete?(): void;
|
||||
|
||||
previewTemplate?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class Dropzone {
|
||||
constructor(container:string|HTMLElement, options?:Dropzone.DropzoneOptions);
|
||||
constructor(container: string | HTMLElement, options?: Dropzone.DropzoneOptions);
|
||||
|
||||
static autoDiscover:boolean;
|
||||
static options:any;
|
||||
static confirm:(question:string, accepted:() => void, rejected?:() => void) => void;
|
||||
static autoDiscover: boolean;
|
||||
static options: any;
|
||||
static confirm: (question: string, accepted: () => void, rejected?: () => void) => void;
|
||||
static createElement(string: string): HTMLElement;
|
||||
static isBrowserSupported(): boolean;
|
||||
static instances: Dropzone[];
|
||||
|
||||
static ADDED:string;
|
||||
static QUEUED:string;
|
||||
static ACCEPTED:string;
|
||||
static UPLOADING:string;
|
||||
static PROCESSING:string;
|
||||
static CANCELED:string;
|
||||
static ERROR:string;
|
||||
static SUCCESS:string;
|
||||
static ADDED: string;
|
||||
static QUEUED: string;
|
||||
static ACCEPTED: string;
|
||||
static UPLOADING: string;
|
||||
static PROCESSING: string;
|
||||
static CANCELED: string;
|
||||
static ERROR: string;
|
||||
static SUCCESS: string;
|
||||
|
||||
files:Dropzone.DropzoneFile[];
|
||||
files: Dropzone.DropzoneFile[];
|
||||
defaultOptions: Dropzone.DropzoneOptions;
|
||||
|
||||
enable():void;
|
||||
enable(): void;
|
||||
|
||||
disable():void;
|
||||
disable(): void;
|
||||
|
||||
destroy():Dropzone;
|
||||
destroy(): Dropzone;
|
||||
|
||||
addFile(file:Dropzone.DropzoneFile):void;
|
||||
addFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
removeFile(file:Dropzone.DropzoneFile):void;
|
||||
removeFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
removeAllFiles(cancelIfNecessary?:boolean):void;
|
||||
removeAllFiles(cancelIfNecessary?: boolean): void;
|
||||
|
||||
processQueue():void;
|
||||
resizeImage(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, callback?: (...args: any[]) => void): void;
|
||||
|
||||
cancelUpload(file:Dropzone.DropzoneFile):void;
|
||||
processQueue(): void;
|
||||
|
||||
processFiles(files:Dropzone.DropzoneFile[]):void;
|
||||
cancelUpload(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
processFile(file:Dropzone.DropzoneFile):void;
|
||||
createThumbnail(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, fixOrientation?: boolean, callback?: (...args: any[]) => void): any;
|
||||
|
||||
uploadFile(file:Dropzone.DropzoneFile):void;
|
||||
createThumbnailFromUrl(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, fixOrientation?: boolean, callback?: (...args: any[]) => void, crossOrigin?: string): any;
|
||||
|
||||
getAcceptedFiles():Dropzone.DropzoneFile[];
|
||||
processFiles(files: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
getRejectedFiles():Dropzone.DropzoneFile[];
|
||||
processFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
getQueuedFiles():Dropzone.DropzoneFile[];
|
||||
uploadFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
getUploadingFiles():Dropzone.DropzoneFile[];
|
||||
uploadFiles(files: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
accept(file:Dropzone.DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
getAcceptedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getActiveFiles():Dropzone.DropzoneFile[];
|
||||
getActiveFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status:string):Dropzone.DropzoneFile[];
|
||||
getAddedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file:Dropzone.DropzoneFile):void;
|
||||
getRejectedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFiles(file:Dropzone.DropzoneFile[]):void;
|
||||
getQueuedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
createThumbnail(file:Dropzone.DropzoneFile, callback?:(...args:any[]) => void):any;
|
||||
getUploadingFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
createThumbnailFromUrl(file:Dropzone.DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
|
||||
accept(file: Dropzone.DropzoneFile, done: (error?: string | Error) => void): void;
|
||||
|
||||
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
|
||||
getActiveFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status: string): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
enqueueFiles(file: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
createThumbnail(file: Dropzone.DropzoneFile, callback?: (...args: any[]) => void): any;
|
||||
|
||||
createThumbnailFromUrl(file: Dropzone.DropzoneFile, url: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
on(eventName: string, callback: (...args: any[]) => void): Dropzone;
|
||||
|
||||
off(): Dropzone;
|
||||
off(eventName:string, callback?:(...args:any[]) => void):Dropzone;
|
||||
off(eventName: string, callback?: (...args: any[]) => void): Dropzone;
|
||||
|
||||
emit(eventName:string, ...args:any[]):Dropzone;
|
||||
emit(eventName: string, ...args: any[]): Dropzone;
|
||||
|
||||
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName: "drop", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragstart", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragend", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragenter", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragover", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragleave", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "paste", callback: (e: DragEvent) => any): Dropzone;
|
||||
|
||||
on(eventName:"reset"):Dropzone;
|
||||
on(eventName: "reset"): Dropzone;
|
||||
|
||||
on(eventName:"addedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"addedfiles", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"removedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"thumbnail", callback:(file:Dropzone.DropzoneFile, dataUrl:string) => any):Dropzone;
|
||||
on(eventName: "addedfile", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "addedfiles", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
on(eventName: "removedfile", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "thumbnail", callback: (file: Dropzone.DropzoneFile, dataUrl: string) => any): Dropzone;
|
||||
|
||||
on(eventName:"error", callback:(file:Dropzone.DropzoneFile, message:string|Error) => any):Dropzone;
|
||||
on(eventName:"errormultiple", callback:(files:Dropzone.DropzoneFile[], message:string|Error) => any):Dropzone;
|
||||
on(eventName: "error", callback: (file: Dropzone.DropzoneFile, message: string | Error) => any): Dropzone;
|
||||
on(eventName: "errormultiple", callback: (files: Dropzone.DropzoneFile[], message: string | Error) => any): Dropzone;
|
||||
|
||||
on(eventName:"processing", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"processingmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "processing", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "processingmultiple", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"uploadprogress", callback:(file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
|
||||
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
|
||||
on(eventName: "uploadprogress", callback: (file: Dropzone.DropzoneFile, progress: number, bytesSent: number) => any): Dropzone;
|
||||
on(eventName: "totaluploadprogress", callback: (totalProgress: number, totalBytes: number, totalBytesSent: number) => any): Dropzone;
|
||||
|
||||
on(eventName:"sending", callback:(file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName:"sendingmultiple", callback:(files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName: "sending", callback: (file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: FormData) => any): Dropzone;
|
||||
on(eventName: "sendingmultiple", callback: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: FormData) => any): Dropzone;
|
||||
|
||||
on(eventName:"success", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"successmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "success", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "successmultiple", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"canceled", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"canceledmultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "canceled", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "canceledmultiple", callback: (file: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"complete", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"completemultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "complete", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "completemultiple", callback: (file: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"maxfilesexceeded", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"maxfilesreached", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"queuecomplete"):Dropzone;
|
||||
on(eventName: "maxfilesexceeded", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "maxfilesreached", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
on(eventName: "queuecomplete"): Dropzone;
|
||||
|
||||
emit(eventName:"drop", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragstart", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragend", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragenter", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragover", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragleave", e:DragEvent):Dropzone;
|
||||
emit(eventName:"paste", e:DragEvent):Dropzone;
|
||||
emit(eventName: "drop", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragstart", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragend", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragenter", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragover", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragleave", e: DragEvent): Dropzone;
|
||||
emit(eventName: "paste", e: DragEvent): Dropzone;
|
||||
|
||||
emit(eventName:"reset"):Dropzone;
|
||||
emit(eventName: "reset"): Dropzone;
|
||||
|
||||
emit(eventName:"addedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"addedfiles", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"removedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"thumbnail", file:Dropzone.DropzoneFile, dataUrl:string):Dropzone;
|
||||
emit(eventName: "addedfile", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "addedfiles", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
emit(eventName: "removedfile", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "thumbnail", file: Dropzone.DropzoneFile, dataUrl: string): Dropzone;
|
||||
|
||||
emit(eventName:"error", file:Dropzone.DropzoneFile, message:string|Error):Dropzone;
|
||||
emit(eventName:"errormultiple", files:Dropzone.DropzoneFile[], message:string|Error):Dropzone;
|
||||
emit(eventName: "error", file: Dropzone.DropzoneFile, message: string | Error): Dropzone;
|
||||
emit(eventName: "errormultiple", files: Dropzone.DropzoneFile[], message: string | Error): Dropzone;
|
||||
|
||||
emit(eventName:"processing", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"processingmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "processing", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "processingmultiple", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"uploadprogress", file:Dropzone.DropzoneFile, progress:number, bytesSent:number):Dropzone;
|
||||
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
|
||||
emit(eventName: "uploadprogress", file: Dropzone.DropzoneFile, progress: number, bytesSent: number): Dropzone;
|
||||
emit(eventName: "totaluploadprogress", totalProgress: number, totalBytes: number, totalBytesSent: number): Dropzone;
|
||||
|
||||
emit(eventName:"sending", file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName:"sendingmultiple", files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName: "sending", file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: FormData): Dropzone;
|
||||
emit(eventName: "sendingmultiple", files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: FormData): Dropzone;
|
||||
|
||||
emit(eventName:"success", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"successmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "success", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "successmultiple", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"canceled", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"canceledmultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "canceled", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "canceledmultiple", file: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"complete", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"completemultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "complete", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "completemultiple", file: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"maxfilesexceeded", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"maxfilesreached", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"queuecomplete"):Dropzone;
|
||||
emit(eventName: "maxfilesexceeded", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "maxfilesreached", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
emit(eventName: "queuecomplete"): Dropzone;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
dropzone(options:Dropzone.DropzoneOptions): Dropzone;
|
||||
dropzone(options: Dropzone.DropzoneOptions): Dropzone;
|
||||
}
|
||||
|
||||
export = Dropzone;
|
||||
|
||||
296
types/dropzone/v4/dropzone-tests.ts
Normal file
296
types/dropzone/v4/dropzone-tests.ts
Normal file
@@ -0,0 +1,296 @@
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function (name:string):string {
|
||||
return name + 'new';
|
||||
};
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
method: "post",
|
||||
withCredentials: false,
|
||||
parallelUploads: 2,
|
||||
uploadMultiple: true,
|
||||
maxFilesize: 1024,
|
||||
paramName: "file",
|
||||
createImageThumbnails: true,
|
||||
maxThumbnailFilesize: 1024,
|
||||
thumbnailWidth: 50,
|
||||
thumbnailHeight: 50,
|
||||
filesizeBase: 1000,
|
||||
maxFiles: 100,
|
||||
params: {
|
||||
additional: "param"
|
||||
},
|
||||
headers: {
|
||||
"Some-Header": "Value"
|
||||
},
|
||||
clickable: true,
|
||||
ignoreHiddenFiles: true,
|
||||
acceptedFiles: "image/*",
|
||||
renameFilename: dropzoneRenameFunction,
|
||||
autoProcessQueue: true,
|
||||
autoQueue: true,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: "<div></div>",
|
||||
hiddenInputContainer: document.createElement("input"),
|
||||
capture: "camera",
|
||||
|
||||
dictDefaultMessage: "",
|
||||
dictFallbackMessage: "",
|
||||
dictFallbackText: "",
|
||||
dictFileTooBig: "",
|
||||
dictInvalidFileType: "",
|
||||
dictResponseError: "",
|
||||
dictCancelUpload: "",
|
||||
dictCancelUploadConfirmation: "",
|
||||
dictRemoveFile: "",
|
||||
dictRemoveFileConfirmation: "",
|
||||
dictMaxFilesExceeded: "",
|
||||
|
||||
accept: (file:Dropzone.DropzoneFile, done:(error?:string|Error) => void) => {
|
||||
if (file.accepted) {
|
||||
file.previewElement.classList.add("accepted");
|
||||
file.previewTemplate.classList.add("accepted");
|
||||
file.previewsContainer.classList.add("accepted");
|
||||
done();
|
||||
}
|
||||
else {
|
||||
done(new Error(file.status));
|
||||
}
|
||||
},
|
||||
init: () => console.log("Initialized"),
|
||||
forceFallback: false,
|
||||
fallback: () => console.log("Fallback"),
|
||||
resize: (file:Dropzone.DropzoneFile) => ({
|
||||
srcX: 0,
|
||||
srcY: 0,
|
||||
trgX: 10,
|
||||
trgY: 10,
|
||||
srcWidth: 100,
|
||||
srcHeight: 100,
|
||||
trgWidth: 50,
|
||||
trgHeight: 50,
|
||||
optWidth: 50,
|
||||
optHeight: 50
|
||||
}),
|
||||
|
||||
drop: (e:DragEvent) => console.log("Drop"),
|
||||
dragstart: (e:DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e:DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e:DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e:DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e:DragEvent) => console.log("Dragleave"),
|
||||
paste: (e:DragEvent) => console.log("Paste"),
|
||||
|
||||
reset: () => console.log("Reset"),
|
||||
|
||||
addedfile: (file:Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files:Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file:Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file:Dropzone.DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
|
||||
|
||||
error: (file:Dropzone.DropzoneFile, message:string|Error) => console.log("Error"),
|
||||
errormultiple: (files:Dropzone.DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
|
||||
|
||||
processing: (file:Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
|
||||
uploadprogress: (file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
|
||||
|
||||
sending: (file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
|
||||
sendingmultiple: (files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
|
||||
|
||||
success: (file:Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
|
||||
canceled: (file:Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file:Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
|
||||
complete: (file:Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file:Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
|
||||
maxfilesexceeded: (file:Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files:Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
queuecomplete: () => console.log("Queuecomplete"),
|
||||
|
||||
previewTemplate: "<div></div>",
|
||||
});
|
||||
|
||||
var dropzoneWithOptionsVariations:Dropzone;
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ".test"
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: document.getElementById("test")
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: [".test", ".test"]
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: [document.getElementById("test"), document.getElementById("test")]
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ["test", document.getElementById("test")]
|
||||
});
|
||||
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:Object) => console.log(file, response)
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:string) => console.log(file, response)
|
||||
});
|
||||
|
||||
const dropzone = new Dropzone(".test");
|
||||
|
||||
dropzone.enable();
|
||||
dropzone.disable();
|
||||
|
||||
dropzone.files.forEach(f => {
|
||||
if (f.xhr) {
|
||||
console.log(f.xhr.readyState)
|
||||
}
|
||||
if (f.accepted) {
|
||||
f.previewElement.classList.add("accepted");
|
||||
f.previewTemplate.classList.add("accepted");
|
||||
f.previewsContainer.classList.add("accepted");
|
||||
}
|
||||
else {
|
||||
console.log(f.status.toUpperCase());
|
||||
}
|
||||
});
|
||||
|
||||
const firstFile = dropzone.files[0];
|
||||
dropzone.removeFile(firstFile);
|
||||
dropzone.addFile(firstFile);
|
||||
dropzone.enqueueFile(firstFile);
|
||||
dropzone.processFile(firstFile);
|
||||
dropzone.uploadFile(firstFile);
|
||||
dropzone.cancelUpload(firstFile);
|
||||
dropzone.createThumbnail(firstFile, () => {
|
||||
console.log("createThumbnail")
|
||||
});
|
||||
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
|
||||
console.log("createThumbnailFromUrl")
|
||||
});
|
||||
dropzone.accept(firstFile, (e:string|Error) => {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
const acceptedFiles = dropzone.getAcceptedFiles();
|
||||
dropzone.processFiles(acceptedFiles);
|
||||
|
||||
const rejectedFiles = dropzone.getRejectedFiles();
|
||||
dropzone.enqueueFiles(rejectedFiles);
|
||||
|
||||
const queuedFiles = dropzone.getQueuedFiles();
|
||||
dropzone.processFiles(queuedFiles);
|
||||
|
||||
const uploadingFiles = dropzone.getUploadingFiles();
|
||||
dropzone.processFiles(uploadingFiles);
|
||||
|
||||
const activeFiles = dropzone.getActiveFiles();
|
||||
dropzone.processFiles(activeFiles);
|
||||
|
||||
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(addedFiles);
|
||||
|
||||
dropzone.processQueue();
|
||||
dropzone.removeAllFiles(true);
|
||||
|
||||
dropzone
|
||||
.on("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.on("dragstart", () => {
|
||||
console.count('dragstart');
|
||||
})
|
||||
.on("dragend", () => {
|
||||
console.count('dragend');
|
||||
})
|
||||
.on("dragenter", () => {
|
||||
console.count('dragenter');
|
||||
})
|
||||
.on("dragover", () => {
|
||||
console.count('dragover');
|
||||
})
|
||||
.on("dragleave", () => {
|
||||
console.count('dragleave');
|
||||
})
|
||||
.on("paste", () => {
|
||||
console.count('paste');
|
||||
})
|
||||
.on("reset", () => {
|
||||
console.count('reset');
|
||||
})
|
||||
.on("addedfile", () => {
|
||||
console.count('addedfile');
|
||||
})
|
||||
.on("addedfiles", () => {
|
||||
console.count('addedfiles');
|
||||
})
|
||||
.on("removedfile", () => {
|
||||
console.count('removedfile');
|
||||
})
|
||||
.on("thumbnail", () => {
|
||||
console.count('thumbnail');
|
||||
})
|
||||
.on("error", () => {
|
||||
console.count('error');
|
||||
})
|
||||
.on("errormultiple", () => {
|
||||
console.count('errormultiple');
|
||||
})
|
||||
.on("processing", () => {
|
||||
console.count('processing');
|
||||
})
|
||||
.on("processingmultiple", () => {
|
||||
console.count('processingmultiple');
|
||||
})
|
||||
.on("uploadprogress", () => {
|
||||
console.count('uploadprogress');
|
||||
})
|
||||
.on("totaluploadprogress", () => {
|
||||
console.count('totaluploadprogress');
|
||||
})
|
||||
.on("sending", () => {
|
||||
console.count('sending');
|
||||
})
|
||||
.on("sendingmultiple", () => {
|
||||
console.count('sendingmultiple');
|
||||
})
|
||||
.on("success", () => {
|
||||
console.count('success');
|
||||
})
|
||||
.on("successmultiple", () => {
|
||||
console.count('successmultiple');
|
||||
})
|
||||
.on("canceled", () => {
|
||||
console.count('canceled');
|
||||
})
|
||||
.on("canceledmultiple", () => {
|
||||
console.count('canceledmultiple');
|
||||
})
|
||||
.on("complete", () => {
|
||||
console.count('complete');
|
||||
})
|
||||
.on("completemultiple", () => {
|
||||
console.count('completemultiple');
|
||||
})
|
||||
.on("maxfilesexceeded", () => {
|
||||
console.count('maxfilesexceeded');
|
||||
})
|
||||
.on("maxfilesreached", () => {
|
||||
console.count('maxfilesreached');
|
||||
})
|
||||
.on("queuecomplete", () => {
|
||||
console.count('queuecomplete');
|
||||
});
|
||||
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.off("dragstart")
|
||||
.off();
|
||||
|
||||
dropzone.destroy();
|
||||
279
types/dropzone/v4/index.d.ts
vendored
Normal file
279
types/dropzone/v4/index.d.ts
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
// Type definitions for Dropzone 4.3.0
|
||||
// Project: http://www.dropzonejs.com/
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
import * as $ from "jquery";
|
||||
|
||||
declare namespace Dropzone {
|
||||
export interface DropzoneResizeInfo {
|
||||
srcX?:number;
|
||||
srcY?:number;
|
||||
trgX?:number;
|
||||
trgY?:number;
|
||||
srcWidth?:number;
|
||||
srcHeight?:number;
|
||||
trgWidth?:number;
|
||||
trgHeight?:number;
|
||||
optWidth?:number;
|
||||
optHeight?:number;
|
||||
}
|
||||
|
||||
export interface DropzoneFile extends File {
|
||||
previewElement: HTMLElement;
|
||||
previewTemplate: HTMLElement;
|
||||
previewsContainer: HTMLElement;
|
||||
status: string;
|
||||
accepted: boolean;
|
||||
xhr?: XMLHttpRequest;
|
||||
}
|
||||
|
||||
export interface DropzoneOptions {
|
||||
url?: string;
|
||||
method?: string;
|
||||
withCredentials?: boolean;
|
||||
parallelUploads?: number;
|
||||
uploadMultiple?: boolean;
|
||||
maxFilesize?: number;
|
||||
paramName?: string;
|
||||
createImageThumbnails?: boolean;
|
||||
maxThumbnailFilesize?: number;
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
filesizeBase?: number;
|
||||
maxFiles?: number;
|
||||
params?: {};
|
||||
headers?: {};
|
||||
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
|
||||
ignoreHiddenFiles?: boolean;
|
||||
acceptedFiles?: string;
|
||||
renameFilename?(name:string): string;
|
||||
autoProcessQueue?: boolean;
|
||||
autoQueue?: boolean;
|
||||
addRemoveLinks?: boolean;
|
||||
previewsContainer?: boolean|string|HTMLElement;
|
||||
hiddenInputContainer?: HTMLElement;
|
||||
capture?: string;
|
||||
|
||||
dictDefaultMessage?: string;
|
||||
dictFallbackMessage?: string;
|
||||
dictFallbackText?: string;
|
||||
dictFileTooBig?: string;
|
||||
dictInvalidFileType?: string;
|
||||
dictResponseError?: string;
|
||||
dictCancelUpload?: string;
|
||||
dictCancelUploadConfirmation?: string;
|
||||
dictRemoveFile?: string;
|
||||
dictRemoveFileConfirmation?: string;
|
||||
dictMaxFilesExceeded?: string;
|
||||
|
||||
accept?(file:DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
init?():void;
|
||||
forceFallback?: boolean;
|
||||
fallback?():void;
|
||||
resize?(file:DropzoneFile):DropzoneResizeInfo;
|
||||
|
||||
drop?(e:DragEvent):void;
|
||||
dragstart?(e:DragEvent):void;
|
||||
dragend?(e:DragEvent):void;
|
||||
dragenter?(e:DragEvent):void;
|
||||
dragover?(e:DragEvent):void;
|
||||
dragleave?(e:DragEvent):void;
|
||||
paste?(e:DragEvent):void;
|
||||
|
||||
reset?():void;
|
||||
|
||||
addedfile?(file:DropzoneFile):void;
|
||||
addedfiles?(files:DropzoneFile[]):void;
|
||||
removedfile?(file:DropzoneFile):void;
|
||||
thumbnail?(file:DropzoneFile, dataUrl:string):void;
|
||||
|
||||
error?(file:DropzoneFile, message:string|Error, xhr:XMLHttpRequest):void;
|
||||
errormultiple?(files:DropzoneFile[], message:string|Error, xhr:XMLHttpRequest):void;
|
||||
|
||||
processing?(file:DropzoneFile):void;
|
||||
processingmultiple?(files:DropzoneFile[]):void;
|
||||
|
||||
uploadprogress?(file:DropzoneFile, progress:number, bytesSent:number):void;
|
||||
totaluploadprogress?(totalProgress:number, totalBytes:number, totalBytesSent:number):void;
|
||||
|
||||
sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
|
||||
|
||||
success?(file: DropzoneFile, response: Object|string): void;
|
||||
successmultiple?(files:DropzoneFile[], responseText:string):void;
|
||||
|
||||
canceled?(file:DropzoneFile):void;
|
||||
canceledmultiple?(file:DropzoneFile[]):void;
|
||||
|
||||
complete?(file:DropzoneFile):void;
|
||||
completemultiple?(file:DropzoneFile[]):void;
|
||||
|
||||
maxfilesexceeded?(file:DropzoneFile):void;
|
||||
maxfilesreached?(files:DropzoneFile[]):void;
|
||||
queuecomplete?():void;
|
||||
|
||||
previewTemplate?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class Dropzone {
|
||||
constructor(container:string|HTMLElement, options?:Dropzone.DropzoneOptions);
|
||||
|
||||
static autoDiscover:boolean;
|
||||
static options:any;
|
||||
static confirm:(question:string, accepted:() => void, rejected?:() => void) => void;
|
||||
|
||||
static ADDED:string;
|
||||
static QUEUED:string;
|
||||
static ACCEPTED:string;
|
||||
static UPLOADING:string;
|
||||
static PROCESSING:string;
|
||||
static CANCELED:string;
|
||||
static ERROR:string;
|
||||
static SUCCESS:string;
|
||||
|
||||
files:Dropzone.DropzoneFile[];
|
||||
|
||||
enable():void;
|
||||
|
||||
disable():void;
|
||||
|
||||
destroy():Dropzone;
|
||||
|
||||
addFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
removeFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
removeAllFiles(cancelIfNecessary?:boolean):void;
|
||||
|
||||
processQueue():void;
|
||||
|
||||
cancelUpload(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
processFiles(files:Dropzone.DropzoneFile[]):void;
|
||||
|
||||
processFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
uploadFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
getAcceptedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getRejectedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getQueuedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getUploadingFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
accept(file:Dropzone.DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
|
||||
getActiveFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status:string):Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
enqueueFiles(file:Dropzone.DropzoneFile[]):void;
|
||||
|
||||
createThumbnail(file:Dropzone.DropzoneFile, callback?:(...args:any[]) => void):any;
|
||||
|
||||
createThumbnailFromUrl(file:Dropzone.DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
|
||||
|
||||
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
|
||||
|
||||
off(): Dropzone;
|
||||
off(eventName:string, callback?:(...args:any[]) => void):Dropzone;
|
||||
|
||||
emit(eventName:string, ...args:any[]):Dropzone;
|
||||
|
||||
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
|
||||
|
||||
on(eventName:"reset"):Dropzone;
|
||||
|
||||
on(eventName:"addedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"addedfiles", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"removedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"thumbnail", callback:(file:Dropzone.DropzoneFile, dataUrl:string) => any):Dropzone;
|
||||
|
||||
on(eventName:"error", callback:(file:Dropzone.DropzoneFile, message:string|Error) => any):Dropzone;
|
||||
on(eventName:"errormultiple", callback:(files:Dropzone.DropzoneFile[], message:string|Error) => any):Dropzone;
|
||||
|
||||
on(eventName:"processing", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"processingmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"uploadprogress", callback:(file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
|
||||
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
|
||||
|
||||
on(eventName:"sending", callback:(file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName:"sendingmultiple", callback:(files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
|
||||
on(eventName:"success", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"successmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"canceled", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"canceledmultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"complete", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"completemultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"maxfilesexceeded", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"maxfilesreached", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"queuecomplete"):Dropzone;
|
||||
|
||||
emit(eventName:"drop", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragstart", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragend", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragenter", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragover", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragleave", e:DragEvent):Dropzone;
|
||||
emit(eventName:"paste", e:DragEvent):Dropzone;
|
||||
|
||||
emit(eventName:"reset"):Dropzone;
|
||||
|
||||
emit(eventName:"addedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"addedfiles", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"removedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"thumbnail", file:Dropzone.DropzoneFile, dataUrl:string):Dropzone;
|
||||
|
||||
emit(eventName:"error", file:Dropzone.DropzoneFile, message:string|Error):Dropzone;
|
||||
emit(eventName:"errormultiple", files:Dropzone.DropzoneFile[], message:string|Error):Dropzone;
|
||||
|
||||
emit(eventName:"processing", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"processingmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"uploadprogress", file:Dropzone.DropzoneFile, progress:number, bytesSent:number):Dropzone;
|
||||
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
|
||||
|
||||
emit(eventName:"sending", file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName:"sendingmultiple", files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
|
||||
emit(eventName:"success", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"successmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"canceled", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"canceledmultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"complete", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"completemultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"maxfilesexceeded", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"maxfilesreached", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"queuecomplete"):Dropzone;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
dropzone(options:Dropzone.DropzoneOptions): Dropzone;
|
||||
}
|
||||
|
||||
export = Dropzone;
|
||||
export as namespace Dropzone;
|
||||
26
types/dropzone/v4/tsconfig.json
Normal file
26
types/dropzone/v4/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"dropzone": ["dropzone/v4"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dropzone-tests.ts"
|
||||
]
|
||||
}
|
||||
126980
types/ej.web.all/index.d.ts
vendored
126980
types/ej.web.all/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2
types/ember/index.d.ts
vendored
2
types/ember/index.d.ts
vendored
@@ -2449,6 +2449,7 @@ declare namespace Ember {
|
||||
function observersFor(obj: any, path: string): any[];
|
||||
function onLoad(name: string, callback: Function): void;
|
||||
const onError: Error;
|
||||
function onerror(error: any): void;
|
||||
function overrideChains(obj: any, keyName: string, m: any): boolean;
|
||||
// ReSharper disable once DuplicatingLocalDeclaration
|
||||
const platform: {
|
||||
@@ -2480,6 +2481,7 @@ declare namespace Ember {
|
||||
throttle(target: any, method: Function | string, ...args: any[]): void;
|
||||
queues: any[];
|
||||
};
|
||||
function runInDebug(fn: Function): void;
|
||||
function runLoadHooks(name: string, object: any): void;
|
||||
function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean;
|
||||
function set(obj: any, keyName: string, value: any): any;
|
||||
|
||||
4
types/enzyme/index.d.ts
vendored
4
types/enzyme/index.d.ts
vendored
@@ -15,7 +15,7 @@ import { ReactElement, Component, HTMLAttributes as ReactHTMLAttributes, SVGAttr
|
||||
|
||||
export type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>;
|
||||
|
||||
export class ElementClass extends Component<any> {
|
||||
export class ElementClass extends Component<any, any> {
|
||||
}
|
||||
|
||||
/* These are purposefully stripped down versions of React.ComponentClass and React.StatelessComponent.
|
||||
@@ -23,7 +23,7 @@ export class ElementClass extends Component<any> {
|
||||
* all specified in the implementation. TS chooses the EnzymePropSelector overload and loses the generics
|
||||
*/
|
||||
export interface ComponentClass<Props> {
|
||||
new (props?: Props, context?: any): Component<Props>;
|
||||
new (props?: Props, context?: any): Component<Props, any>;
|
||||
}
|
||||
|
||||
export type StatelessComponent<Props> = (props: Props, context?: any) => JSX.Element;
|
||||
|
||||
3
types/express-flash-2/express-flash-2-tests.ts
Normal file
3
types/express-flash-2/express-flash-2-tests.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import flash from "express-flash-2";
|
||||
|
||||
flash();
|
||||
57
types/express-flash-2/index.d.ts
vendored
Normal file
57
types/express-flash-2/index.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// Type definitions for express-flash-2 1.0
|
||||
// Project: https://github.com/jack2gs/express-flash-2
|
||||
// Definitions by: Matheus Salmi <https://github.com/mathsalmi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Express {
|
||||
interface Request {
|
||||
session?: Session;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
flash: Flash;
|
||||
}
|
||||
|
||||
interface Flash {
|
||||
[key: string]: any[];
|
||||
}
|
||||
|
||||
interface Response {
|
||||
/**
|
||||
* Queue flash `msg` of the given `type`.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* req.flash('info', 'email sent');
|
||||
* req.flash('error', 'email delivery failed');
|
||||
* req.flash('info', 'email re-sent');
|
||||
*
|
||||
*
|
||||
* Formatting:
|
||||
*
|
||||
* Flash notifications also support arbitrary formatting support.
|
||||
* For example you may pass variable arguments to `req.flash()`
|
||||
* and use the %s specifier to be replaced by the associated argument:
|
||||
*
|
||||
* req.flash('info', 'email has been sent to %s.', userName);
|
||||
*
|
||||
* Formatting uses `util.format()`, which is available on Node 0.6+.
|
||||
*/
|
||||
flash(type: string, msg: string | any[]): void;
|
||||
|
||||
locals: {
|
||||
flash: Flash
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'express-flash-2' {
|
||||
import express = require('express');
|
||||
|
||||
/**
|
||||
* Expose `flash()` function on responses.
|
||||
*/
|
||||
function flash(): express.RequestHandler;
|
||||
|
||||
export = flash;
|
||||
}
|
||||
22
types/express-flash-2/tsconfig.json
Normal file
22
types/express-flash-2/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-flash-2-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/express-flash-2/tslint.json
Normal file
8
types/express-flash-2/tslint.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-single-declare-module": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"expect": false
|
||||
}
|
||||
}
|
||||
24
types/express-serve-static-core/index.d.ts
vendored
24
types/express-serve-static-core/index.d.ts
vendored
@@ -239,9 +239,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* // => "json"
|
||||
*/
|
||||
accepts(): string[];
|
||||
accepts(type: string): string | boolean;
|
||||
accepts(type: string[]): string | boolean;
|
||||
accepts(...type: string[]): string | boolean;
|
||||
accepts(type: string): string | false;
|
||||
accepts(type: string[]): string | false;
|
||||
accepts(...type: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted charset of the specified character sets,
|
||||
@@ -252,9 +252,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param charset
|
||||
*/
|
||||
acceptsCharsets(): string[];
|
||||
acceptsCharsets(charset: string): string | boolean;
|
||||
acceptsCharsets(charset: string[]): string | boolean;
|
||||
acceptsCharsets(...charset: string[]): string | boolean;
|
||||
acceptsCharsets(charset: string): string | false;
|
||||
acceptsCharsets(charset: string[]): string | false;
|
||||
acceptsCharsets(...charset: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted encoding of the specified encodings,
|
||||
@@ -265,9 +265,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param encoding
|
||||
*/
|
||||
acceptsEncodings(): string[];
|
||||
acceptsEncodings(encoding: string): string | boolean;
|
||||
acceptsEncodings(encoding: string[]): string | boolean;
|
||||
acceptsEncodings(...encoding: string[]): string | boolean;
|
||||
acceptsEncodings(encoding: string): string | false;
|
||||
acceptsEncodings(encoding: string[]): string | false;
|
||||
acceptsEncodings(...encoding: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted language of the specified languages,
|
||||
@@ -279,9 +279,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param lang
|
||||
*/
|
||||
acceptsLanguages(): string[];
|
||||
acceptsLanguages(lang: string): string | boolean;
|
||||
acceptsLanguages(lang: string[]): string | boolean;
|
||||
acceptsLanguages(...lang: string[]): string | boolean;
|
||||
acceptsLanguages(lang: string): string | false;
|
||||
acceptsLanguages(lang: string[]): string | false;
|
||||
acceptsLanguages(...lang: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Parse Range header field,
|
||||
|
||||
@@ -51,22 +51,22 @@ namespace express_tests {
|
||||
router.route('/users')
|
||||
.get((req, res, next) => {
|
||||
let types: string[] = req.accepts();
|
||||
let type: string | boolean = req.accepts('json');
|
||||
let type: string | false = req.accepts('json');
|
||||
type = req.accepts(['json', 'text']);
|
||||
type = req.accepts('json', 'text');
|
||||
|
||||
let charsets: string[] = req.acceptsCharsets();
|
||||
let charset: string | boolean = req.acceptsCharsets('utf-8');
|
||||
let charset: string | false = req.acceptsCharsets('utf-8');
|
||||
charset = req.acceptsCharsets(['utf-8', 'utf-16']);
|
||||
charset = req.acceptsCharsets('utf-8', 'utf-16');
|
||||
|
||||
let encodings: string[] = req.acceptsEncodings();
|
||||
let encoding: string | boolean = req.acceptsEncodings('gzip');
|
||||
let encoding: string | false = req.acceptsEncodings('gzip');
|
||||
encoding = req.acceptsEncodings(['gzip', 'deflate']);
|
||||
encoding = req.acceptsEncodings('gzip', 'deflate');
|
||||
|
||||
let languages: string[] = req.acceptsLanguages();
|
||||
let language: string | boolean = req.acceptsLanguages('en');
|
||||
let language: string | false = req.acceptsLanguages('en');
|
||||
language = req.acceptsLanguages(['en', 'ja']);
|
||||
language = req.acceptsLanguages('en', 'ja');
|
||||
|
||||
|
||||
2
types/gapi.auth2/index.d.ts
vendored
2
types/gapi.auth2/index.d.ts
vendored
@@ -47,7 +47,7 @@ declare namespace gapi.auth2 {
|
||||
/**
|
||||
* Get permission from the user to access the specified scopes offline.
|
||||
*/
|
||||
grantOfflineAccess(options: {
|
||||
grantOfflineAccess(options?: {
|
||||
scope?: string;
|
||||
prompt?: "select_account" | "consent";
|
||||
app_package_name?: string;
|
||||
|
||||
3
types/google-map-react/index.d.ts
vendored
3
types/google-map-react/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for google-map-react 0.22
|
||||
// Type definitions for google-map-react 0.23
|
||||
// Project: https://github.com/istarkov/google-map-react
|
||||
// Definitions by: Honza Brecka <https://github.com/honzabrecka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -15,6 +15,7 @@ export interface Options {
|
||||
mapTypeControl?: boolean;
|
||||
minZoomOverride?: boolean;
|
||||
minZoom?: number;
|
||||
maxZoom?: number;
|
||||
gestureHandling?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Test file for Google Maps JavaScript API Definition file
|
||||
|
||||
/***** Create map *****/
|
||||
let map = new google.maps.Map(
|
||||
document.getElementById('map'), {
|
||||
let mapOptions: google.maps.MapOptions = {
|
||||
backgroundColor: "#fff",
|
||||
center: { lat: -25.363, lng: 131.044 },
|
||||
clickableIcons: true,
|
||||
@@ -13,8 +11,34 @@ let map = new google.maps.Map(
|
||||
},
|
||||
gestureHandling: "cooperative",
|
||||
scrollwheel: true,
|
||||
styles: [
|
||||
{
|
||||
elementType: 'geometry',
|
||||
featureType: 'water',
|
||||
stylers: [
|
||||
{
|
||||
color: '#00bdbd'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
elementType: 'geometry',
|
||||
featureType: 'landscape.man_made',
|
||||
stylers: [
|
||||
{
|
||||
color: '#f7f1df'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
zoom: 4
|
||||
});
|
||||
};
|
||||
|
||||
/***** Create map *****/
|
||||
let map: google.maps.Map = new google.maps.Map(
|
||||
document.getElementById('map'),
|
||||
mapOptions
|
||||
);
|
||||
|
||||
|
||||
/***** Data *****/
|
||||
@@ -329,4 +353,4 @@ heatmap.setData([new google.maps.LatLng(37.782551, -122.445368), new google.maps
|
||||
heatmap.setData([
|
||||
{ weight: 1, location: new google.maps.LatLng(37.782551, -122.445368) },
|
||||
{ weight: 2, location: new google.maps.LatLng(37.782745, -122.444586) }
|
||||
]);
|
||||
]);
|
||||
|
||||
111
types/googlemaps/index.d.ts
vendored
111
types/googlemaps/index.d.ts
vendored
@@ -1058,7 +1058,7 @@ declare namespace google.maps {
|
||||
clickable?: boolean;
|
||||
/** If set to true, the user can drag this circle over the map. Defaults to false. */
|
||||
draggable?: boolean;
|
||||
/**
|
||||
/**
|
||||
* If set to true, the user can edit this circle by dragging the control points shown at the center and around
|
||||
* the circumference of the circle. Defaults to false.
|
||||
*/
|
||||
@@ -1719,64 +1719,51 @@ declare namespace google.maps {
|
||||
stylers?: MapTypeStyler[];
|
||||
}
|
||||
|
||||
export interface MapTypeStyleFeatureType {
|
||||
administrative?: {
|
||||
country?: string;
|
||||
land_parcel?: string;
|
||||
locality?: string;
|
||||
neighborhood?: string;
|
||||
province?: string;
|
||||
};
|
||||
all?: string;
|
||||
landscape?: {
|
||||
man_made?: string;
|
||||
natural?: {
|
||||
landcover?: string;
|
||||
terrain?: string;
|
||||
};
|
||||
};
|
||||
poi?: {
|
||||
attraction?: string;
|
||||
business?: string;
|
||||
government?: string;
|
||||
medical?: string;
|
||||
park?: string;
|
||||
place_of_worship?: string;
|
||||
school?: string;
|
||||
sports_complex?: string;
|
||||
};
|
||||
road?: {
|
||||
arterial?: string;
|
||||
highway?: {
|
||||
controlled_access?: string;
|
||||
};
|
||||
local?: string;
|
||||
};
|
||||
transit?: {
|
||||
line?: string;
|
||||
station?: {
|
||||
airport?: string;
|
||||
bus?: string;
|
||||
rail?: string;
|
||||
};
|
||||
};
|
||||
water?: string;
|
||||
}
|
||||
export type MapTypeStyleFeatureType =
|
||||
'all' |
|
||||
'administrative' |
|
||||
'administrative.country' |
|
||||
'administrative.land_parcel' |
|
||||
'administrative.locality' |
|
||||
'administrative.neighborhood' |
|
||||
'administrative.province' |
|
||||
'landscape' |
|
||||
'landscape.man_made' |
|
||||
'landscape.natural' |
|
||||
'landscape.natural.landcover' |
|
||||
'landscape.natural.terrain' |
|
||||
'poi' |
|
||||
'poi.attraction' |
|
||||
'poi.business' |
|
||||
'poi.government' |
|
||||
'poi.medical' |
|
||||
'poi.park' |
|
||||
'poi.place_of_worship' |
|
||||
'poi.school' |
|
||||
'poi.sports_complex' |
|
||||
'road' |
|
||||
'road.arterial' |
|
||||
'road.highway' |
|
||||
'road.highway.controlled_access' |
|
||||
'road.local' |
|
||||
'transit' |
|
||||
'transit.line' |
|
||||
'transit.station' |
|
||||
'transit.station.airport' |
|
||||
'transit.station.bus' |
|
||||
'transit.station.rail' |
|
||||
'water';
|
||||
|
||||
export interface MapTypeStyleElementType {
|
||||
all?: string;
|
||||
geometry?: {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
};
|
||||
labels?: {
|
||||
icon?: string;
|
||||
text?: {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
}
|
||||
};
|
||||
}
|
||||
export type MapTypeStyleElementType =
|
||||
'all' |
|
||||
'geometry' |
|
||||
'geometry.fill' |
|
||||
'geometry.stroke' |
|
||||
'labels' |
|
||||
'labels.icon' |
|
||||
'labels.text' |
|
||||
'labels.text.fill' |
|
||||
'labels.text.stroke';
|
||||
|
||||
export interface MapTypeStyler {
|
||||
color?: string;
|
||||
@@ -2132,7 +2119,7 @@ declare namespace google.maps {
|
||||
}
|
||||
|
||||
/**
|
||||
* This object is returned from various mouse events on the map and overlays,
|
||||
* This object is returned from various mouse events on the map and overlays,
|
||||
* and contains all the fields shown below.
|
||||
*/
|
||||
export interface MouseEvent {
|
||||
@@ -2233,7 +2220,7 @@ declare namespace google.maps {
|
||||
/** Converts to string. */
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the
|
||||
* Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the
|
||||
* southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.
|
||||
*/
|
||||
toUrlValue(precision?: number): string;
|
||||
@@ -2718,7 +2705,7 @@ declare namespace google.maps {
|
||||
* and the map property of a new polygon is always set to the DrawingManager's map.
|
||||
*/
|
||||
polygonOptions?: PolygonOptions;
|
||||
/**
|
||||
/**
|
||||
* Options to apply to any new polylines created with this DrawingManager. The path property is ignored,
|
||||
* and the map property of a new polyline is always set to the DrawingManager's map.
|
||||
*/
|
||||
@@ -2749,7 +2736,7 @@ declare namespace google.maps {
|
||||
*/
|
||||
export enum OverlayType {
|
||||
/**
|
||||
* Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete
|
||||
* Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete
|
||||
* event is a circle.
|
||||
*/
|
||||
CIRCLE,
|
||||
|
||||
@@ -160,3 +160,16 @@ enterprieseRouter.calculateIsoline(
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
|
||||
// Create a clustering provider
|
||||
const clusteredDataProvider = new H.clustering.Provider([], {
|
||||
clusteringOptions: {
|
||||
// Maximum radius of the neighborhood
|
||||
eps: 64,
|
||||
// minimum weight of points required to form a cluster
|
||||
minWeight: 3
|
||||
}
|
||||
});
|
||||
|
||||
// Create a layer that will consume objects from our clustering provider
|
||||
const layer = new H.map.layer.ObjectLayer(clusteredDataProvider);
|
||||
|
||||
25
types/heremaps/index.d.ts
vendored
25
types/heremaps/index.d.ts
vendored
@@ -2938,7 +2938,7 @@ declare namespace H {
|
||||
* @param provider {H.map.provider.ObjectProvider} - the ObjectProvider which provides the map objects to this object layer.
|
||||
* @param opt_options {H.map.layer.ObjectLayer.Options=} - The options for this layer
|
||||
*/
|
||||
constructor(provider: H.map.provider.ObjectProvider, opt_options?: H.map.layer.ObjectLayer.Options);
|
||||
constructor(provider: H.map.provider.ObjectProvider | H.clustering.Provider, opt_options?: H.map.layer.ObjectLayer.Options);
|
||||
|
||||
/**
|
||||
* This method returns current ObjectLayer's data provider
|
||||
@@ -4017,6 +4017,17 @@ declare namespace H {
|
||||
type Options = any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This property specifies collection of pre-configured HERE layers
|
||||
*/
|
||||
interface DefaultLayers {
|
||||
normal: H.service.MapType;
|
||||
satellite: H.service.MapType;
|
||||
terrain: H.service.MapType;
|
||||
incidents: H.map.layer.MarkerTileLayer;
|
||||
venues: H.map.layer.TileLayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class encapsulates Enterprise Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance.
|
||||
* H.service.Platform#getEnterpriseRoutingService.
|
||||
@@ -4473,17 +4484,19 @@ declare namespace H {
|
||||
/**
|
||||
* This method creates a pre-configured set of HERE tile layers for convenient use with the map.
|
||||
* @param opt_tileSize {(H.service.Platform.DefaultLayersOptions | number)=} - When a number – optional tile size to be queried from the HERE Map Tile API, default is 256.
|
||||
* If theparameter is an object, then it represents options and all remaining below parameters should be omitted.
|
||||
* If this parameter is a number, it indicates the tile size to be queried from the HERE Map Tile API (the default value is 256); if this parameter is an object, it represents
|
||||
* configuration options for the layer and all the remaining parameters (below) should be omitted
|
||||
* @param opt_ppi {number=} - optional 'ppi' parameter to use when querying tiles, default is not specified
|
||||
* @param opt_lang {string=} - optional primary language parameter, default is not specified
|
||||
* @param opt_secondaryLang {string=} - optional secondary language parameter, default is not specified
|
||||
* @param opt_style {string=} - optional 'style' parameter to use when querying map tiles, default is not specified
|
||||
* @param opt_pois {(string | boolean)=} - indicates if pois are displayed on the map. Pass true to indicate that all pois should be visible. Alternatively you can specify mask for the
|
||||
* POI Categories as described at the Map Tile API documentation POI Categories chapter.
|
||||
* @returns {Object<string, H.service.MapType>} - a set of tile layers ready to use
|
||||
* @returns {H.service.DefaultLayers} - a set of tile layers ready to use
|
||||
*/
|
||||
createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number, opt_lang?: string, opt_secondaryLang?: string, opt_style?: string,
|
||||
opt_pois?: (string | boolean)): H.service.Platform.MapTypes;
|
||||
createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number,
|
||||
opt_lang?: string, opt_secondaryLang?: string, opt_style?: string,
|
||||
opt_pois?: (string | boolean)): H.service.DefaultLayers;
|
||||
|
||||
/**
|
||||
* This method returns an instance of H.service.RoutingService to query the Routing API.
|
||||
@@ -5681,7 +5694,7 @@ declare namespace H {
|
||||
* @param opt_locale {(H.ui.i18n.Localization | string)=} - the language to use (or a full localization object).
|
||||
* @returns {H.ui.UI} - the UI instance configured with the default controls
|
||||
*/
|
||||
static createDefault(map: H.Map, mapTypes: H.service.Platform.MapTypes, opt_locale?: H.ui.i18n.Localization | string): UI;
|
||||
static createDefault(map: H.Map, mapTypes: H.service.Platform.MapTypes | H.service.DefaultLayers, opt_locale?: H.ui.i18n.Localization | string): H.ui.UI;
|
||||
|
||||
/**
|
||||
* This method is used to capture the element view
|
||||
|
||||
24
types/hls.js/index.d.ts
vendored
24
types/hls.js/index.d.ts
vendored
@@ -757,39 +757,39 @@ declare namespace Hls {
|
||||
* Half of the estimate is based on the last abrEwmaSlowLive seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastLive
|
||||
*/
|
||||
arbEwmaSlowLive: number;
|
||||
abrEwmaSlowLive: number;
|
||||
/**
|
||||
* (default: 4.0)
|
||||
* Fast bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaFastVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than 0
|
||||
*/
|
||||
arbEwmaFastVod: number;
|
||||
abrEwmaFastVod: number;
|
||||
/**
|
||||
* (default: 15.0)
|
||||
* Slow bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaSlowVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastVoD
|
||||
*/
|
||||
arbEwmaSlowVod: number;
|
||||
abrEwmaSlowVod: number;
|
||||
/**
|
||||
* (default: 500000)
|
||||
* Default bandwidth estimate in bits/second prior to collecting fragment bandwidth samples.
|
||||
* parameter should be a float
|
||||
*/
|
||||
arbEwmaDefaultEstimate: number;
|
||||
abrEwmaDefaultEstimate: number;
|
||||
/**
|
||||
* (default: 0.8)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can stay on current or lower quality level.
|
||||
* If abrBandWidthFactor * bandwidth average < level.bitrate then ABR can switch to that level providing that it is equal or less than current level.
|
||||
*/
|
||||
arbBandWidthFactor: number;
|
||||
abrBandWidthFactor: number;
|
||||
/**
|
||||
* (default: 0.7)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can switch up to a higher quality level.
|
||||
* If abrBandWidthUpFactor * bandwidth average < level.bitrate then ABR can switch up to that quality level.
|
||||
*/
|
||||
arbBandWidthUpFactor: number;
|
||||
abrBandWidthUpFactor: number;
|
||||
/**
|
||||
* (default: false)
|
||||
* max bitrate used in ABR by avg measured bitrate i.e. if bitrate signaled in variant manifest for a given level is 2Mb/s but average bitrate measured on this level is 2.5Mb/s,
|
||||
@@ -1161,39 +1161,39 @@ declare namespace Hls {
|
||||
* Half of the estimate is based on the last abrEwmaSlowLive seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastLive
|
||||
*/
|
||||
arbEwmaSlowLive?: number;
|
||||
abrEwmaSlowLive?: number;
|
||||
/**
|
||||
* (default: 4.0)
|
||||
* Fast bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaFastVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than 0
|
||||
*/
|
||||
arbEwmaFastVod?: number;
|
||||
abrEwmaFastVod?: number;
|
||||
/**
|
||||
* (default: 15.0)
|
||||
* Slow bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaSlowVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastVoD
|
||||
*/
|
||||
arbEwmaSlowVod?: number;
|
||||
abrEwmaSlowVod?: number;
|
||||
/**
|
||||
* (default: 500000)
|
||||
* Default bandwidth estimate in bits/second prior to collecting fragment bandwidth samples.
|
||||
* parameter should be a float
|
||||
*/
|
||||
arbEwmaDefaultEstimate?: number;
|
||||
abrEwmaDefaultEstimate?: number;
|
||||
/**
|
||||
* (default: 0.8)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can stay on current or lower quality level.
|
||||
* If abrBandWidthFactor * bandwidth average < level.bitrate then ABR can switch to that level providing that it is equal or less than current level.
|
||||
*/
|
||||
arbBandWidthFactor?: number;
|
||||
abrBandWidthFactor?: number;
|
||||
/**
|
||||
* (default: 0.7)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can switch up to a higher quality level.
|
||||
* If abrBandWidthUpFactor * bandwidth average < level.bitrate then ABR can switch up to that quality level.
|
||||
*/
|
||||
arbBandWidthUpFactor?: number;
|
||||
abrBandWidthUpFactor?: number;
|
||||
/**
|
||||
* (default: false)
|
||||
* max bitrate used in ABR by avg measured bitrate i.e. if bitrate signaled in variant manifest for a given level is 2Mb/s but average bitrate measured on this level is 2.5Mb/s,
|
||||
|
||||
@@ -1,31 +1,40 @@
|
||||
import * as i18next from 'i18next';
|
||||
import LngDetector from 'i18next-browser-languagedetector';
|
||||
import * as i18next from "i18next";
|
||||
import * as LngDetector from "i18next-browser-languagedetector";
|
||||
|
||||
var options = {
|
||||
const options: LngDetector.DetectorOptions = {
|
||||
// order and from where user language should be detected
|
||||
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
|
||||
order: ["querystring", "cookie", "localStorage", "navigator", "htmlTag"],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
lookupQuerystring: "lng",
|
||||
lookupCookie: "i18next",
|
||||
lookupLocalStorage: "i18nextLng",
|
||||
|
||||
// cache user language on
|
||||
caches: ['localStorage', 'cookie'],
|
||||
caches: ["localStorage", "cookie"],
|
||||
excludeCacheFor: ["cimode"], // languages to not persist (cookie, localStorage)
|
||||
|
||||
// optional expire and domain for set cookie
|
||||
cookieMinutes: 10,
|
||||
cookieDomain: 'myDomain'
|
||||
};
|
||||
var myDetector = {
|
||||
name: 'myDetectorsName',
|
||||
cookieDomain: "myDomain",
|
||||
|
||||
lookup(options: Object) {
|
||||
// optional htmlTag with lang attribute, the default is:
|
||||
htmlTag: document.documentElement
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
const customDetector: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
return 'en';
|
||||
return "en";
|
||||
},
|
||||
|
||||
cacheUserLanguage(lng: string, options: Object) {
|
||||
cacheUserLanguage(lng: string, options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
// lng -> current language, will be called after init and on changeLanguage
|
||||
|
||||
@@ -33,10 +42,20 @@ var myDetector = {
|
||||
}
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
const customDetector2: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const lngDetector = new LngDetector(null, options);
|
||||
|
||||
lngDetector.init(options);
|
||||
lngDetector.addDetector(myDetector);
|
||||
lngDetector.addDetector(customDetector);
|
||||
|
||||
i18next
|
||||
.use(lngDetector)
|
||||
.init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
122
types/i18next-browser-languagedetector/index.d.ts
vendored
122
types/i18next-browser-languagedetector/index.d.ts
vendored
@@ -1,86 +1,64 @@
|
||||
// Type definitions for i18next-browser-languagedetector 0.0.14
|
||||
// Type definitions for i18next-browser-languagedetector 2.0
|
||||
// Project: http://i18next.com/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="i18next"/>
|
||||
/// <reference types="express" />
|
||||
|
||||
declare namespace I18next {
|
||||
interface I18nextStatic extends i18nextBrowserLanguageDetector.I18nextStatic { }
|
||||
interface I18nextOptions extends i18nextBrowserLanguageDetector.I18nextOptions { }
|
||||
}
|
||||
|
||||
declare namespace i18nextBrowserLanguageDetector {
|
||||
/**
|
||||
* @summary Interface for Language detector options.
|
||||
* @interface
|
||||
*/
|
||||
interface LanguageDetectorOptions {
|
||||
caches?: Array<string>|boolean;
|
||||
cookieDomain?: string;
|
||||
cookieExpirationDate?: Date;
|
||||
lookupCookie?: string;
|
||||
lookupFromPathIndex?: number;
|
||||
interface DetectorOptions {
|
||||
/**
|
||||
* order and from where user language should be detected
|
||||
*/
|
||||
order?: Array<"querystring" | "cookie" | "localStorage" | "navigator" | "htmlTag" | string>;
|
||||
|
||||
/**
|
||||
* keys or params to lookup language from
|
||||
*/
|
||||
lookupQuerystring?: string;
|
||||
lookupSession?: string;
|
||||
order?: Array<string>;
|
||||
lookupCookie?: string;
|
||||
lookupLocalStorage?: string;
|
||||
|
||||
/**
|
||||
* cache user language on
|
||||
*/
|
||||
caches?: string[];
|
||||
|
||||
/**
|
||||
* languages to not persist (cookie, localStorage)
|
||||
*/
|
||||
excludeCacheFor?: string[];
|
||||
|
||||
/**
|
||||
* optional expire and domain for set cookie
|
||||
* @default 10
|
||||
*/
|
||||
cookieMinutes?: number;
|
||||
cookieDomain?: string;
|
||||
|
||||
/**
|
||||
* optional htmlTag with lang attribute
|
||||
* @default document.documentElement
|
||||
*/
|
||||
htmlTag?: HTMLElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for custom detector.
|
||||
* @interface
|
||||
*/
|
||||
interface CustomDetector {
|
||||
name: string;
|
||||
|
||||
//todo: Checks paramters type.
|
||||
cacheUserLanguage: (lng: string, options: Object) => void;
|
||||
lookup: (options: Object) => string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next options.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextOptions {
|
||||
detection?: LanguageDetectorOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next interface.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextStatic {
|
||||
use(module: LngDetector): I18nextStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next language detection.
|
||||
* @class
|
||||
*/
|
||||
class LngDetector {
|
||||
/**
|
||||
* @summary Constructor.
|
||||
* @constructor
|
||||
*/
|
||||
constructor(services?: any, options?: LanguageDetectorOptions);
|
||||
|
||||
/**
|
||||
* @summary Adds detector.
|
||||
* @param {CustomDetector} detector The custom detector.
|
||||
*/
|
||||
addDetector(detector: CustomDetector): LngDetector;
|
||||
|
||||
/**
|
||||
* @summary Initializes detector.
|
||||
* @param {LanguageDetectorOptions} options The options.
|
||||
*/
|
||||
init(options?: LanguageDetectorOptions): void;
|
||||
cacheUserLanguage?(lng: string, options: DetectorOptions): void;
|
||||
lookup(options: DetectorOptions): string | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "i18next-browser-languagedetector" {
|
||||
declare class i18nextBrowserLanguageDetector {
|
||||
constructor(services?: any, options?: i18nextBrowserLanguageDetector.DetectorOptions);
|
||||
/**
|
||||
* Adds detector.
|
||||
*/
|
||||
addDetector(detector: i18nextBrowserLanguageDetector.CustomDetector): i18nextBrowserLanguageDetector;
|
||||
|
||||
export default i18nextBrowserLanguageDetector.LngDetector;
|
||||
/**
|
||||
* Initializes detector.
|
||||
*/
|
||||
init(options?: i18nextBrowserLanguageDetector.DetectorOptions): void;
|
||||
}
|
||||
|
||||
export = i18nextBrowserLanguageDetector;
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -19,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"i18next-browser-languagedetector-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1
types/i18next-browser-languagedetector/tslint.json
Normal file
1
types/i18next-browser-languagedetector/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,42 @@
|
||||
import * as i18next from 'i18next';
|
||||
import LngDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
const options = {
|
||||
// order and from where user language should be detected
|
||||
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
|
||||
// cache user language on
|
||||
caches: ['localStorage', 'cookie'],
|
||||
|
||||
// optional expire and domain for set cookie
|
||||
cookieMinutes: 10,
|
||||
cookieDomain: 'myDomain'
|
||||
};
|
||||
const myDetector = {
|
||||
name: 'myDetectorsName',
|
||||
|
||||
lookup(options: {}) {
|
||||
// options -> are passed in options
|
||||
return 'en';
|
||||
},
|
||||
|
||||
cacheUserLanguage(lng: string, options: {}) {
|
||||
// options -> are passed in options
|
||||
// lng -> current language, will be called after init and on changeLanguage
|
||||
|
||||
// store it
|
||||
}
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
const lngDetector = new LngDetector(null, options);
|
||||
lngDetector.init(options);
|
||||
lngDetector.addDetector(myDetector);
|
||||
82
types/i18next-browser-languagedetector/v0/index.d.ts
vendored
Normal file
82
types/i18next-browser-languagedetector/v0/index.d.ts
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
// Type definitions for i18next-browser-languagedetector 0.0
|
||||
// Project: http://i18next.com/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as i18next from "i18next";
|
||||
|
||||
declare namespace I18next {
|
||||
interface I18nextStatic extends i18nextBrowserLanguageDetector.I18nextStatic { }
|
||||
interface I18nextOptions extends i18nextBrowserLanguageDetector.I18nextOptions { }
|
||||
}
|
||||
|
||||
declare namespace i18nextBrowserLanguageDetector {
|
||||
/**
|
||||
* @summary Interface for Language detector options.
|
||||
* @interface
|
||||
*/
|
||||
interface LanguageDetectorOptions {
|
||||
caches?: string[] | boolean;
|
||||
cookieDomain?: string;
|
||||
cookieExpirationDate?: Date;
|
||||
lookupCookie?: string;
|
||||
lookupFromPathIndex?: number;
|
||||
lookupQuerystring?: string;
|
||||
lookupSession?: string;
|
||||
order?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for custom detector.
|
||||
* @interface
|
||||
*/
|
||||
interface CustomDetector {
|
||||
name: string;
|
||||
|
||||
// todo: Checks paramters type.
|
||||
cacheUserLanguage(lng: string, options: {}): void;
|
||||
lookup(options: {}): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next options.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextOptions {
|
||||
detection?: LanguageDetectorOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next interface.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextStatic {
|
||||
use(module: LngDetector): I18nextStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next language detection.
|
||||
* @class
|
||||
*/
|
||||
class LngDetector {
|
||||
/**
|
||||
* @summary Constructor.
|
||||
* @constructor
|
||||
*/
|
||||
constructor(services?: any, options?: LanguageDetectorOptions);
|
||||
|
||||
/**
|
||||
* @summary Adds detector.
|
||||
* @param {CustomDetector} detector The custom detector.
|
||||
*/
|
||||
addDetector(detector: CustomDetector): LngDetector;
|
||||
|
||||
/**
|
||||
* @summary Initializes detector.
|
||||
* @param {LanguageDetectorOptions} options The options.
|
||||
*/
|
||||
init(options?: LanguageDetectorOptions): void;
|
||||
}
|
||||
}
|
||||
|
||||
export default i18nextBrowserLanguageDetector.LngDetector;
|
||||
27
types/i18next-browser-languagedetector/v0/tsconfig.json
Normal file
27
types/i18next-browser-languagedetector/v0/tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"i18next-browser-languagedetector": [
|
||||
"i18next-browser-languagedetector/v0"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"i18next-browser-languagedetector-tests.ts"
|
||||
]
|
||||
}
|
||||
11
types/i18next-browser-languagedetector/v0/tslint.json
Normal file
11
types/i18next-browser-languagedetector/v0/tslint.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [
|
||||
false
|
||||
],
|
||||
"no-empty-interface": [
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,30 @@
|
||||
import * as i18next from 'i18next';
|
||||
import XHR from 'i18next-xhr-backend';
|
||||
import * as i18next from "i18next";
|
||||
import * as XHR from "i18next-xhr-backend";
|
||||
|
||||
let options = {
|
||||
loadPath: '',
|
||||
addPath: '',
|
||||
const options: XHR.BackendOptions = {
|
||||
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
||||
addPath: "locales/add/{{lng}}/{{ns}}",
|
||||
allowMultiLoading: false,
|
||||
parse: function(data:string) { return data.replace(/a/g, ''); },
|
||||
parse: (data: string) => data.replace(/a/g, ""),
|
||||
crossDomain: false,
|
||||
withCredentials: false,
|
||||
ajax: function (url:string, options:Object, callback: Function, data: Object) {}
|
||||
ajax: (url: string, options: XHR.BackendOptions, callback: XHR.AjaxRequestCallback, data: {}) => { },
|
||||
queryStringParams: { v: "1.3.5" }
|
||||
};
|
||||
|
||||
i18next.use(XHR).init({
|
||||
backend: options
|
||||
});
|
||||
i18next
|
||||
.use(XHR)
|
||||
.init({
|
||||
backend: options
|
||||
});
|
||||
|
||||
let xhr = new XHR(null, options);
|
||||
const xhr = new XHR();
|
||||
xhr.init(options);
|
||||
const xhr2 = new XHR(null, options);
|
||||
const type: string = xhr.type;
|
||||
const newOptions: XHR.BackendOptions = xhr.options;
|
||||
xhr.create("en", "ns", "key", "value");
|
||||
xhr.create(["en", "us"], "ns", "key", "value");
|
||||
xhr.read("en", "ns", (error: any, result: string | false) => { });
|
||||
xhr.readMulti(["en"], ["ns"], (error: any, result: string | false) => { });
|
||||
xhr.loadUrl("someurl", (error: any, result: string) => { });
|
||||
|
||||
96
types/i18next-xhr-backend/index.d.ts
vendored
96
types/i18next-xhr-backend/index.d.ts
vendored
@@ -1,36 +1,74 @@
|
||||
// Type definitions for i18next-xhr-backend 1.2.0
|
||||
// Type definitions for i18next-xhr-backend 1.4
|
||||
// Project: https://github.com/i18next/i18next-xhr-backend
|
||||
// Definitions by: Jan Mühlemann <https://github.com/jamuhl>
|
||||
// Definitions by: Jan Mühlemann <https://github.com/jamuhl>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'i18next-xhr-backend' {
|
||||
|
||||
interface Interpolator {
|
||||
interpolate: () => string
|
||||
}
|
||||
interface Services {
|
||||
interpolator: Interpolator
|
||||
}
|
||||
declare namespace I18NextXhrBackend {
|
||||
type LoadPathOption = string | ((lngs: string[], namespaces: string[]) => string);
|
||||
|
||||
interface BackendOptions {
|
||||
loadPath?: string | Function,
|
||||
addPath?: string,
|
||||
allowMultiLoading?: boolean,
|
||||
parse?: Function,
|
||||
crossDomain?: boolean,
|
||||
withCredentials?: boolean,
|
||||
ajax?: Function
|
||||
/**
|
||||
* path where resources get loaded from, or a function
|
||||
* returning a path:
|
||||
* function(lngs, namespaces) { return customPath; }
|
||||
* the returned path will interpolate lng, ns if provided like giving a static path
|
||||
*/
|
||||
loadPath?: LoadPathOption;
|
||||
/**
|
||||
* path to post missing resources
|
||||
*/
|
||||
addPath?: string;
|
||||
/**
|
||||
* your backend server supports multiLoading
|
||||
* locales/resources.json?lng=de+en&ns=ns1+ns2
|
||||
* set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading
|
||||
*/
|
||||
allowMultiLoading?: boolean;
|
||||
/**
|
||||
* parse data after it has been fetched
|
||||
* in example use https://www.npmjs.com/package/json5
|
||||
* here it removes the letter a from the json (bad idea)
|
||||
*/
|
||||
parse?(data: string): string;
|
||||
/**
|
||||
* allow cross domain requests
|
||||
*/
|
||||
crossDomain?: boolean;
|
||||
/**
|
||||
* allow credentials on cross domain requests
|
||||
*/
|
||||
withCredentials?: boolean;
|
||||
/**
|
||||
* define a custom xhr function
|
||||
* can be used to support XDomainRequest in IE 8 and 9
|
||||
*/
|
||||
ajax?(url: string, options: BackendOptions, callback: AjaxRequestCallback, data: {} | string, cache: boolean): void;
|
||||
/**
|
||||
* adds parameters to resource URL. 'example.com' -> 'example.com?v=1.3.5'
|
||||
*/
|
||||
queryStringParams?: { [key: string]: string };
|
||||
|
||||
/**
|
||||
* @see https://github.com/i18next/i18next-xhr-backend/blob/281c7e235e1157b33122adacef1957252e5700f1/src/ajax.js#L52
|
||||
*/
|
||||
customHeaders?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export default class Backend {
|
||||
type: 'backend';
|
||||
services: Services;
|
||||
options: BackendOptions;
|
||||
constructor(services?: Services, options?: BackendOptions);
|
||||
init(services?: Services, options?: BackendOptions): void;
|
||||
readMulti(languages: any[], namespaces: any[], callback: Function): void;
|
||||
read(language: {}, namespace: {}, callback: Function): void;
|
||||
loadUrl(url: string, callback: Function): void;
|
||||
create(languages: any[], namespace: string, key: string, fallbackValue: string): void;
|
||||
}
|
||||
}
|
||||
type AjaxRequestCallback = (response: string, x: XMLHttpRequest) => void;
|
||||
|
||||
type LoadCallback = (error: any, result: string | false) => void;
|
||||
}
|
||||
|
||||
declare class I18NextXhrBackend {
|
||||
constructor(services?: any, options?: I18NextXhrBackend.BackendOptions);
|
||||
init(options?: I18NextXhrBackend.BackendOptions): void;
|
||||
readMulti(languages: string[], namespaces: string[], callback: I18NextXhrBackend.LoadCallback): void;
|
||||
read(language: string, namespace: string, callback: I18NextXhrBackend.LoadCallback): void;
|
||||
loadUrl(url: string, callback: I18NextXhrBackend.LoadCallback): void;
|
||||
create(languages: string | string[], namespace: string, key: string, fallbackValue: string): void;
|
||||
type: "backend";
|
||||
services: any;
|
||||
options: I18NextXhrBackend.BackendOptions;
|
||||
}
|
||||
|
||||
export = I18NextXhrBackend;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
@@ -19,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"i18next-xhr-backend-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1
types/i18next-xhr-backend/tslint.json
Normal file
1
types/i18next-xhr-backend/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
1
types/is-alphanumerical/tslint.json
Normal file
1
types/is-alphanumerical/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -31,6 +31,8 @@ Note that while the factory function ignores the second parameter, it is require
|
||||
- Tests generated from examples in jQuery documentation.
|
||||
- [test/longdesc-tests.ts](test/longdesc-tests.ts)
|
||||
- Tests generated from non-example snippets in jQuery documentation.
|
||||
- [test/learn-tests.ts](test/learn-tests.ts)
|
||||
- Tests imported from examples in [jQuery Learning Center](https://learn.jquery.com).
|
||||
- [test/jquery-window-module-tests.ts](test/jquery-window-module-tests.ts)<br>
|
||||
[test/jquery-slim-window-module-tests.ts](test/jquery-slim-window-module-tests.ts)
|
||||
- Tests importing jQuery with a DOM available
|
||||
|
||||
17
types/jquery/test/learn-tests.ts
Normal file
17
types/jquery/test/learn-tests.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// From https://learn.jquery.com/plugins/basic-plugin-creation/
|
||||
|
||||
// Basic Plugin Authoring
|
||||
|
||||
interface JQuery {
|
||||
greenify: GreenifyPlugin;
|
||||
}
|
||||
|
||||
interface GreenifyPlugin {
|
||||
(this: JQuery): void;
|
||||
}
|
||||
|
||||
jQuery.fn.greenify = function() {
|
||||
this.css( "color", "green" );
|
||||
};
|
||||
|
||||
jQuery( "a" ).greenify(); // Makes all the links green.
|
||||
@@ -22,6 +22,7 @@
|
||||
"jquery-tests.ts",
|
||||
"test/example-tests.ts",
|
||||
"test/longdesc-tests.ts",
|
||||
"test/learn-tests.ts",
|
||||
"test/jquery-no-window-module-tests.ts",
|
||||
"test/jquery-window-module-tests.ts",
|
||||
"test/jquery-slim-no-window-module-tests.ts",
|
||||
|
||||
4
types/js-yaml/index.d.ts
vendored
4
types/js-yaml/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for js-yaml 3.5.2
|
||||
// Type definitions for js-yaml 3.9.0
|
||||
// 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
|
||||
@@ -51,6 +51,8 @@ declare namespace jsyaml {
|
||||
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 {
|
||||
|
||||
25
types/jsnox/index.d.ts
vendored
25
types/jsnox/index.d.ts
vendored
@@ -1,11 +1,10 @@
|
||||
// Type definitions for JSnoX
|
||||
// Type definitions for JSnoX 2.1
|
||||
// Project: https://github.com/af/jsnox
|
||||
// Definitions by: Steve Baker <https://github.com/stkb/>
|
||||
// Dovydas Navickas <https://github.com/DovydasNavickas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="react" />
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
/*
|
||||
@@ -13,13 +12,10 @@ import * as React from "react";
|
||||
* This will normally be the React object but could be something else
|
||||
*/
|
||||
interface ReactLikeObject {
|
||||
createElement<P>(type: React.ComponentClass<P> | string,
|
||||
props: P, children: React.ReactNode): React.ReactElement<P>;
|
||||
createElement<P>(type: React.ComponentClass<P> | string, props: P, children: React.ReactNode): React.ReactElement<P>;
|
||||
}
|
||||
|
||||
interface Module {
|
||||
(reactObj: ReactLikeObject): CreateElement
|
||||
}
|
||||
type Module = (reactObj: ReactLikeObject) => CreateElement;
|
||||
|
||||
interface CreateElement {
|
||||
/**
|
||||
@@ -30,7 +26,7 @@ interface CreateElement {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(specString: string, children: React.ReactNode): React.DOMElement<P, Element>
|
||||
<P>(specString: string, children: React.ReactNode): React.DOMElement<P, Element>;
|
||||
|
||||
/**
|
||||
* Renders an HTML element from the given spec string, with optional props
|
||||
@@ -41,8 +37,7 @@ interface CreateElement {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(specString: string, props?: React.HTMLAttributes<{}>, children?: React.ReactNode): React.DOMElement<P, Element>
|
||||
|
||||
<P>(specString: string, props?: React.HTMLAttributes<{}>, children?: React.ReactNode): React.DOMElement<P, Element>;
|
||||
|
||||
/**
|
||||
* Renders a React component, with children but no props
|
||||
@@ -51,7 +46,7 @@ interface CreateElement {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(component: React.ComponentClass<P>, children: React.ReactNode): React.ReactElement<P>
|
||||
<P>(component: React.ComponentClass<P>, children: React.ReactNode): React.ReactElement<P>;
|
||||
|
||||
/**
|
||||
* Renders a React component, with optional props and children
|
||||
@@ -61,8 +56,8 @@ interface CreateElement {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(component: React.ComponentClass<P>, props?: P, children?: React.ReactNode): React.ReactElement<P>
|
||||
<P>(component: React.ComponentClass<P>, props?: P, children?: React.ReactNode): React.ReactElement<P>;
|
||||
}
|
||||
|
||||
declare var exports: Module
|
||||
export = exports
|
||||
declare var exports: Module;
|
||||
export = exports;
|
||||
|
||||
@@ -1,57 +1,56 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import * as jsnox from 'jsnox';
|
||||
var $ = jsnox(React);
|
||||
import * as React from "react";
|
||||
import * as jsnox from "jsnox";
|
||||
let $ = jsnox(React);
|
||||
|
||||
interface PersonProps {
|
||||
firstName: string
|
||||
lastName: string
|
||||
age: number
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
var Person = React.createClass<PersonProps, {}>({
|
||||
render():React.ReactElement<any> { return null; }
|
||||
let Person: React.ClassicComponentClass<PersonProps> = React.createClass<PersonProps, {}>({
|
||||
render(): React.ReactElement<any> { return null; }
|
||||
});
|
||||
|
||||
var PersonTag = React.createFactory(Person);
|
||||
let PersonTag = React.createFactory(Person);
|
||||
|
||||
var clickHandler: React.MouseEventHandler<{}>;
|
||||
let clickHandler: React.MouseEventHandler<{}>;
|
||||
|
||||
// Tests with spec string
|
||||
function spec_string () {
|
||||
var result: React.ReactHTMLElement<HTMLElement>
|
||||
// tests with spec string
|
||||
function spec_string(): void {
|
||||
let result: React.DOMElement<React.DOMAttributes<Element>, Element>;
|
||||
|
||||
// just spec string
|
||||
result = $('div')
|
||||
result = $("div");
|
||||
|
||||
// No properties, just children
|
||||
result = $('div', 'hello') // one string child
|
||||
result = $('div', $('span', 'world')) // one element child
|
||||
result = $('div', ['hello', $('span', 'world')]) // mixed array of children
|
||||
// no properties, just children
|
||||
result = $("div", "hello"); // one string child
|
||||
result = $("div", $("span", "world")); // one element child
|
||||
result = $("div", ["hello", $("span", "world")]); // mixed array of children
|
||||
|
||||
// With html properties
|
||||
result = $('div', { onClick: clickHandler }) // no children
|
||||
result = $('div', { onClick: clickHandler }, 'hello') // one string child
|
||||
result = $('div', { onClick: clickHandler }, $('span', 'world')) // one element child
|
||||
result = $('div', { onClick: clickHandler }, ['hello', $('span', 'world')]) // mixed array of children
|
||||
// with html properties
|
||||
result = $("div", { onClick: clickHandler }); // no children
|
||||
result = $("div", { onClick: clickHandler }, "hello"); // one string child
|
||||
result = $("div", { onClick: clickHandler }, $("span", "world")); // one element child
|
||||
result = $("div", { onClick: clickHandler }, ["hello", $("span", "world")]); // mixed array of children
|
||||
}
|
||||
|
||||
// Tests with react component
|
||||
function react_component() {
|
||||
var result: React.ReactElement<{}>
|
||||
// tests with react component
|
||||
function react_component(): void {
|
||||
let result: React.ReactElement<{}>;
|
||||
|
||||
// with nothing more
|
||||
result = $(Person)
|
||||
result = $(Person);
|
||||
|
||||
// No properties, just children
|
||||
result = $(Person, 'hello') // one string child
|
||||
result = $(Person, $('span', 'world')) // one element child
|
||||
result = $(Person, ['hello', $('span', 'world')]) // mixed array of children
|
||||
// no properties, just children
|
||||
result = $(Person, "hello"); // one string child
|
||||
result = $(Person, $("span", "world")); // one element child
|
||||
result = $(Person, ["hello", $("span", "world")]); // mixed array of children
|
||||
|
||||
// With component props
|
||||
var props = { firstName: 'Bob', lastName: 'Garfield', age: 72 }
|
||||
result = $(Person, props) // no children
|
||||
result = $(Person, props, 'hello') // one string child
|
||||
result = $(Person, props, $('span', 'world')) // one element child
|
||||
result = $(Person, props, ['hello', PersonTag()]) // mixed array of children
|
||||
// with component props
|
||||
let props: PersonProps = { firstName: "Bob", lastName: "Garfield", age: 72 };
|
||||
result = $(Person, props); // no children
|
||||
result = $(Person, props, "hello"); // one string child
|
||||
result = $(Person, props, $("span", "world")); // one element child
|
||||
result = $(Person, props, ["hello", PersonTag()]); // mixed array of children
|
||||
}
|
||||
|
||||
1
types/jsnox/tslint.json
Normal file
1
types/jsnox/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
19
types/jsonp/index.d.ts
vendored
Normal file
19
types/jsonp/index.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Type definitions for jsonp 0.2
|
||||
// Project: https://github.com/LearnBoost/jsonp
|
||||
// Definitions by: Savva Surenkov <https://github.com/surenkov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = jsonp;
|
||||
|
||||
declare function jsonp(url: string, options?: Options, cb?: RequestCallback): CancelFn;
|
||||
declare function jsonp(url: string, callback?: RequestCallback): CancelFn;
|
||||
|
||||
type CancelFn = () => void;
|
||||
type RequestCallback = (error: Error | null, data: any) => void;
|
||||
|
||||
interface Options {
|
||||
param?: string;
|
||||
prefix?: string;
|
||||
name?: string;
|
||||
timeout?: number;
|
||||
}
|
||||
28
types/jsonp/jsonp-tests.ts
Normal file
28
types/jsonp/jsonp-tests.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import jsonp = require('jsonp');
|
||||
|
||||
/**
|
||||
* Dummy response callback.
|
||||
*/
|
||||
const print = (err: Error | null, data: any) =>
|
||||
console.log(err !== null ? err.message : data);
|
||||
|
||||
/**
|
||||
* Tests jsonp request with default parameters.
|
||||
*/
|
||||
const cancel1 = jsonp('https://jsonplaceholder.typicode.com/posts/1', print);
|
||||
cancel1();
|
||||
|
||||
/**
|
||||
* Tests parametrized jsonp request.
|
||||
*/
|
||||
const cancel2 = jsonp(
|
||||
'https://jsonplaceholder.typicode.com/posts/1',
|
||||
{
|
||||
param: 'cb',
|
||||
timeout: 40000,
|
||||
prefix: '_jsonp',
|
||||
name: 'func',
|
||||
},
|
||||
print,
|
||||
);
|
||||
cancel2();
|
||||
21
types/jsonp/tsconfig.json
Normal file
21
types/jsonp/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jsonp-tests.ts"
|
||||
]
|
||||
}
|
||||
6
types/jsonp/tslint.json
Normal file
6
types/jsonp/tslint.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false
|
||||
}
|
||||
}
|
||||
63
types/jsonpath/index.d.ts
vendored
63
types/jsonpath/index.d.ts
vendored
@@ -1,18 +1,65 @@
|
||||
// Type definitions for jsonpath 0.1.3
|
||||
// Type definitions for jsonpath 0.2.11
|
||||
// Project: https://www.npmjs.org/package/jsonpath
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>, Ika <https://github.com/ikatyang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
|
||||
type PathComponent = string | number;
|
||||
|
||||
export declare function query(obj: any, pathExpression: string): any[];
|
||||
export declare function paths(obj: any, pathExpression: string): PathComponent[][];
|
||||
export declare function nodes(obj: any, pathExpression: string): { path: PathComponent[]; value: any; }[];
|
||||
/**
|
||||
* Find elements in `obj` matching `pathExpression`. Returns an array of elements that
|
||||
* satisfy the provided JSONPath expression,or an empty array if none were matched.
|
||||
* Returns only first `count` elements if specified.
|
||||
*/
|
||||
export declare function query(obj: any, pathExpression: string, count?: number): any[];
|
||||
|
||||
/**
|
||||
* Find paths to elements in `obj` matching `pathExpression`. Returns an array of
|
||||
* element paths that satisfy the provided JSONPath expression. Each path is itself an
|
||||
* array of keys representing the location within `obj` of the matching element. Returns
|
||||
* only first `count` paths if specified.
|
||||
*/
|
||||
export declare function paths(obj: any, pathExpression: string, count?: number): PathComponent[][];
|
||||
|
||||
/**
|
||||
* Find elements and their corresponding paths in `obj` matching `pathExpression`.
|
||||
* Returns an array of node objects where each node has a `path` containing an array of
|
||||
* keys representing the location within `obj`, and a `value` pointing to the matched
|
||||
* element. Returns only first `count` nodes if specified.
|
||||
*/
|
||||
export declare function nodes(obj: any, pathExpression: string, count?: number): { path: PathComponent[]; value: any; }[];
|
||||
|
||||
/**
|
||||
* Returns the value of the first element matching `pathExpression`. If `newValue` is
|
||||
* provided, sets the value of the first matching element and returns the new value.
|
||||
*/
|
||||
export declare function value(obj: any, pathExpression: string): any;
|
||||
export declare function value(obj: any, pathExpression: string, newValue: any): any;
|
||||
export declare function value<T>(obj: any, pathExpression: string, newValue: T): T;
|
||||
|
||||
/**
|
||||
* Returns the parent of the first matching element.
|
||||
*/
|
||||
export declare function parent(obj: any, pathExpression: string): any;
|
||||
|
||||
/**
|
||||
* Runs the supplied function `fn` on each matching element, and replaces each
|
||||
* matching element with the return value from the function. The function accepts the
|
||||
* value of the matching element as its only parameter. Returns matching nodes with
|
||||
* their updated values.
|
||||
*/
|
||||
export declare function apply(obj: any, pathExpression: string, fn: (x: any) => any): { path: PathComponent[]; value: any; }[];
|
||||
|
||||
/**
|
||||
* Parse the provided JSONPath expression into path components and their associated
|
||||
* operations.
|
||||
*/
|
||||
export declare function parse(pathExpression: string): any[];
|
||||
|
||||
/**
|
||||
* Returns a path expression in string form, given a path. The supplied path may either
|
||||
* be a flat array of keys, as returned by `jp.nodes` for example, or may alternatively be a
|
||||
* fully parsed path expression in the form of an array of path components as returned
|
||||
* by `jp.parse`.
|
||||
*/
|
||||
export declare function stringify(path: PathComponent[]): string;
|
||||
|
||||
export as namespace jsonpath;
|
||||
|
||||
@@ -1,54 +1,31 @@
|
||||
|
||||
import jp = require('jsonpath');
|
||||
|
||||
var data: any;
|
||||
|
||||
/**
|
||||
* jp.query(obj, pathExpression)
|
||||
* Find elements in obj matching pathExpression. Returns an array of elements that satisfy the provided JSONPath expression, or an empty array if none were matched.
|
||||
*/
|
||||
// jp.query()
|
||||
var authors = jp.query(data, '$..author');
|
||||
var authors = jp.query(data, '$..author', 2);
|
||||
|
||||
/**
|
||||
* jp.paths(obj, pathExpression)
|
||||
* Find elements in obj matching pathExpression. Returns an array of element paths that satisfy the provided JSONPath expression. Each path is itself an array of keys representing the location within obj of the matching element.
|
||||
*/
|
||||
// jp.paths()
|
||||
var paths = jp.paths(data, '$..author');
|
||||
var paths = jp.paths(data, '$..author', 2);
|
||||
|
||||
/**
|
||||
* jp.nodes(obj, pathExpression)
|
||||
* Find elements and their corresponding paths in obj matching pathExpression. Returns an array of node objects where each node has a path containing an array of keys representing the location within obj, and a value pointing to the matched element.
|
||||
*/
|
||||
// jp.nodes()
|
||||
var nodes = jp.nodes(data, '$..author');
|
||||
var nodes = jp.nodes(data, '$..author', 2);
|
||||
|
||||
/**
|
||||
* jp.value(obj, pathExpression, [newValue])
|
||||
* Returns the value of the first element matching pathExpression. If newValue is provided, sets the value of the first matching element and returns the new value.
|
||||
*/
|
||||
// jp.value()
|
||||
var value = jp.value(data, '$.store..price');
|
||||
jp.value(data, '$.store..price', 12.5);
|
||||
|
||||
/**
|
||||
* jp.parent(obj, pathExpression)
|
||||
* Returns the parent of the first matching element.
|
||||
*/
|
||||
// jp.parent()
|
||||
var parent = jp.parent(data, '$.store..price');
|
||||
|
||||
/**
|
||||
* jp.apply(obj, pathExpression, fn)
|
||||
* Runs the supplied function fn on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.
|
||||
*/
|
||||
// jp.apply()
|
||||
var nodes = jp.apply(data, '$..author', (value: string) => { return value.toUpperCase() });
|
||||
|
||||
/**
|
||||
* jp.parse(pathExpression)
|
||||
* Parse the provided JSONPath expression into path components and their associated operations.
|
||||
*/
|
||||
// jp.parse()
|
||||
var path = jp.parse('$..author');
|
||||
|
||||
/**
|
||||
* jp.stringify(path)
|
||||
* Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by jp.nodes for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by jp.parse.
|
||||
*/
|
||||
// jp.stringify()
|
||||
var pathExpression = jp.stringify(['$', 'store', 'book', 0, 'author']);
|
||||
|
||||
|
||||
7
types/jsonwebtoken/index.d.ts
vendored
7
types/jsonwebtoken/index.d.ts
vendored
@@ -27,7 +27,7 @@ export class NotBeforeError extends JsonWebTokenError {
|
||||
export interface SignOptions {
|
||||
/**
|
||||
* Signature algorithm. Could be one of these values :
|
||||
* - HS256: HMAC using SHA-256 hash algorithm
|
||||
* - HS256: HMAC using SHA-256 hash algorithm (default)
|
||||
* - HS384: HMAC using SHA-384 hash algorithm
|
||||
* - HS512: HMAC using SHA-512 hash algorithm
|
||||
* - RS256: RSASSA using SHA-256 hash algorithm
|
||||
@@ -40,9 +40,10 @@ export interface SignOptions {
|
||||
*/
|
||||
algorithm?: string;
|
||||
keyid?: string;
|
||||
/** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */
|
||||
/** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */
|
||||
expiresIn?: string | number;
|
||||
notBefore?: string;
|
||||
/** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */
|
||||
notBefore?: string | number;
|
||||
audience?: string | string[];
|
||||
subject?: string;
|
||||
issuer?: string;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user