mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -32,7 +32,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi
|
||||
|
||||
## Requested definitions
|
||||
|
||||
Here is are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
|
||||
Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -12,4 +12,12 @@ var config : adal.Config = {
|
||||
|
||||
var auth = new AuthenticationContext(config);
|
||||
|
||||
Logging.log = (message: string) => {
|
||||
console.log(message);
|
||||
}
|
||||
|
||||
Logging.level = 4;
|
||||
|
||||
auth.info("Logging message");
|
||||
|
||||
var userName: string = auth.getCachedUser().userName;
|
||||
Vendored
+14
-1
@@ -4,9 +4,10 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var AuthenticationContext: adal.AuthenticationContextStatic;
|
||||
declare var Logging: adal.Logging;
|
||||
|
||||
declare module 'adal' {
|
||||
export = AuthenticationContext;
|
||||
export = { AuthenticationContext, Logging };
|
||||
}
|
||||
|
||||
declare namespace adal {
|
||||
@@ -36,6 +37,18 @@ declare namespace adal {
|
||||
stateResponse: string,
|
||||
requestType: string
|
||||
}
|
||||
|
||||
interface Logging {
|
||||
log: (message: string) => void;
|
||||
level: LoggingLevel;
|
||||
}
|
||||
|
||||
enum LoggingLevel {
|
||||
ERROR = 0,
|
||||
WARNING = 1,
|
||||
INFO = 2,
|
||||
VERBOSE = 3
|
||||
}
|
||||
|
||||
interface AuthenticationContextStatic {
|
||||
new (config: Config): AuthenticationContext;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ declare namespace angular.translate {
|
||||
}
|
||||
|
||||
interface ITranslateProvider extends angular.IServiceProvider {
|
||||
translations(): ITranslationTable;
|
||||
translations(key?: string): ITranslationTable;
|
||||
translations(key: string, translationTable: ITranslationTable): ITranslateProvider;
|
||||
cloakClassName(): string;
|
||||
cloakClassName(name: string): ITranslateProvider;
|
||||
|
||||
@@ -869,7 +869,7 @@ angular.module('docsTabsExample', [])
|
||||
|
||||
angular.module('componentExample', [])
|
||||
.component('counter', {
|
||||
require: ['^ctrl'],
|
||||
require: {'ctrl': '^ctrl'},
|
||||
bindings: {
|
||||
count: '='
|
||||
},
|
||||
|
||||
Vendored
+2
-2
@@ -156,7 +156,7 @@ declare namespace angular {
|
||||
|
||||
noop(...args: any[]): void;
|
||||
reloadWithDebugInfo(): void;
|
||||
toJson(obj: any, pretty?: boolean): string;
|
||||
toJson(obj: any, pretty?: boolean | number): string;
|
||||
uppercase(str: string): string;
|
||||
version: {
|
||||
full: string;
|
||||
@@ -1716,7 +1716,7 @@ declare namespace angular {
|
||||
* Whether transclusion is enabled. Enabled by default.
|
||||
*/
|
||||
transclude?: boolean | string | {[slot: string]: string};
|
||||
require?: string | string[] | {[controller: string]: string};
|
||||
require?: {[controller: string]: string};
|
||||
}
|
||||
|
||||
interface IComponentTemplateFn {
|
||||
|
||||
@@ -27,7 +27,26 @@ var config: Microsoft.ApplicationInsights.IConfig = {
|
||||
cookieDomain: ""
|
||||
};
|
||||
|
||||
var appInsights = new Microsoft.ApplicationInsights.AppInsights(config);
|
||||
var appInsights: Microsoft.ApplicationInsights.IAppInsights = {
|
||||
config: config,
|
||||
context: null,
|
||||
queue: null,
|
||||
|
||||
startTrackPage(name?: string) { return null; },
|
||||
stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
|
||||
trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number) { return null; },
|
||||
startTrackEvent(name: string) { return null },
|
||||
stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null },
|
||||
trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null },
|
||||
trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string) { return null },
|
||||
trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null },
|
||||
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null },
|
||||
trackTrace(message: string, properties?: { [name: string]: string; }) { return null },
|
||||
flush() { return null },
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null },
|
||||
clearAuthenticatedUserContext() { return null },
|
||||
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null }
|
||||
};
|
||||
|
||||
// trackPageView
|
||||
appInsights.trackPageView("page1");
|
||||
@@ -68,7 +87,7 @@ appInsights.config.instrumentationKey = "<new key>";
|
||||
|
||||
|
||||
// TelementryContext
|
||||
var context = appInsights.context;
|
||||
var context: Microsoft.ApplicationInsights.ITelemetryContext = appInsights.context;
|
||||
|
||||
context.application.ver = "v0.0.0";
|
||||
context.application.build = "1.1.1";
|
||||
@@ -89,7 +108,7 @@ context.operation.syntheticSource = "testAgent";
|
||||
|
||||
// track
|
||||
var data = new Microsoft.Telemetry.Base();
|
||||
var envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(data, "name");
|
||||
var envelope = new Microsoft.Telemetry.Envelope();
|
||||
|
||||
context.track(envelope);
|
||||
|
||||
|
||||
+243
-323
@@ -3,399 +3,297 @@
|
||||
// Definitions by: Kamil Szostak <https://github.com/kamilszostak>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module AI {
|
||||
enum SeverityLevel {
|
||||
Verbose = 0,
|
||||
Information = 1,
|
||||
Warning = 2,
|
||||
Error = 3,
|
||||
Critical = 4,
|
||||
}
|
||||
}
|
||||
|
||||
declare module Microsoft.ApplicationInsights.Context {
|
||||
class Application {
|
||||
interface IApplication {
|
||||
/**
|
||||
* The application version.
|
||||
*/
|
||||
ver: string;
|
||||
|
||||
/**
|
||||
* The application build version.
|
||||
*/
|
||||
build: string;
|
||||
}
|
||||
|
||||
class Device {
|
||||
|
||||
interface IDevice {
|
||||
/**
|
||||
* The type for the current device.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* A device unique ID.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The device OEM for the current device.
|
||||
*/
|
||||
oemName: string;
|
||||
|
||||
/**
|
||||
* The device model for the current device.
|
||||
*/
|
||||
model: string;
|
||||
|
||||
/**
|
||||
* The IANA interface type for the internet connected network adapter.
|
||||
*/
|
||||
network: number;
|
||||
|
||||
/**
|
||||
* The application screen resolution.
|
||||
*/
|
||||
resolution: string;
|
||||
|
||||
/**
|
||||
* The current display language of the operating system.
|
||||
*/
|
||||
locale: string;
|
||||
|
||||
/**
|
||||
* The IP address.
|
||||
*/
|
||||
ip: string;
|
||||
|
||||
/**
|
||||
* The device language.
|
||||
*/
|
||||
language: string;
|
||||
|
||||
/**
|
||||
* The OS name.
|
||||
*/
|
||||
os: string;
|
||||
|
||||
/**
|
||||
* The OS version.
|
||||
*/
|
||||
osversion: string;
|
||||
|
||||
/**
|
||||
* Constructs a new instance of the Device class
|
||||
*/
|
||||
constructor();
|
||||
}
|
||||
|
||||
class User {
|
||||
/**
|
||||
* The user ID.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Authenticated user id
|
||||
*/
|
||||
authenticatedId: string;
|
||||
|
||||
/**
|
||||
* The account ID.
|
||||
*/
|
||||
accountId: string;
|
||||
|
||||
/**
|
||||
* The account acquisition date.
|
||||
*/
|
||||
accountAcquisitionDate: string;
|
||||
|
||||
/**
|
||||
* The user agent string.
|
||||
*/
|
||||
agent: string;
|
||||
|
||||
/**
|
||||
* The store region.
|
||||
*/
|
||||
storeRegion: string;
|
||||
|
||||
/**
|
||||
* Sets the autheticated user id and the account id in this session.
|
||||
*
|
||||
* @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.
|
||||
* @param accountId {string} - An optional string to represent the account associated with the authenticated user.
|
||||
*/
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): void;
|
||||
|
||||
/**
|
||||
* Clears the authenticated user id and the account id from the user context.
|
||||
* @returns {}
|
||||
*/
|
||||
clearAuthenticatedUserContext(): void;
|
||||
|
||||
constructor(config: ITelemetryConfig);
|
||||
}
|
||||
|
||||
class Session {
|
||||
/**
|
||||
* The session ID.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The true if this is the first session
|
||||
*/
|
||||
isFirst: boolean;
|
||||
|
||||
/**
|
||||
* The date at which this guid was genereated.
|
||||
* Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds ellapse from this time.
|
||||
*/
|
||||
acquisitionDate: number;
|
||||
|
||||
/**
|
||||
* The date at which this session ID was last reported.
|
||||
* This value should be updated whenever telemetry is sent using this ID.
|
||||
* Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
|
||||
*/
|
||||
renewalDate: number;
|
||||
}
|
||||
|
||||
class Location {
|
||||
|
||||
interface ILocation {
|
||||
/**
|
||||
* Client IP address for reverse lookup
|
||||
*/
|
||||
ip: string;
|
||||
}
|
||||
|
||||
class Operation {
|
||||
interface IInternal {
|
||||
/**
|
||||
* Unique id
|
||||
* The SDK version used to create this telemetry item.
|
||||
*/
|
||||
sdkVersion: string;
|
||||
/**
|
||||
* The SDK agent version.
|
||||
*/
|
||||
agentVersion: string;
|
||||
}
|
||||
|
||||
interface ISample {
|
||||
/**
|
||||
* Sample rate
|
||||
*/
|
||||
sampleRate: number;
|
||||
}
|
||||
|
||||
interface ISession {
|
||||
/**
|
||||
* The session ID.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The true if this is the first session
|
||||
*/
|
||||
isFirst: boolean;
|
||||
/**
|
||||
* The date at which this guid was genereated.
|
||||
* Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds ellapse from this time.
|
||||
*/
|
||||
acquisitionDate: number;
|
||||
/**
|
||||
* The date at which this session ID was last reported.
|
||||
* This value should be updated whenever telemetry is sent using this ID.
|
||||
* Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
|
||||
*/
|
||||
renewalDate: number;
|
||||
}
|
||||
|
||||
interface IOperation {
|
||||
/**
|
||||
* Operation id
|
||||
*/
|
||||
id: string;
|
||||
|
||||
name: string;
|
||||
|
||||
parentId: string;
|
||||
|
||||
rootId: string;
|
||||
|
||||
/**
|
||||
* String identifying the bot or test agent.
|
||||
* Operation name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Parent operation id
|
||||
*/
|
||||
parentId: string;
|
||||
/**
|
||||
* Root operation id
|
||||
*/
|
||||
rootId: string;
|
||||
/**
|
||||
* Synthetic source of the operation
|
||||
*/
|
||||
syntheticSource: string;
|
||||
}
|
||||
|
||||
interface IUser {
|
||||
/**
|
||||
* The telemetry configuration.
|
||||
*/
|
||||
config: any;
|
||||
/**
|
||||
* The user ID.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Authenticated user id
|
||||
*/
|
||||
authenticatedId: string;
|
||||
/**
|
||||
* The account ID.
|
||||
*/
|
||||
accountId: string;
|
||||
/**
|
||||
* The account acquisition date.
|
||||
*/
|
||||
accountAcquisitionDate: string;
|
||||
/**
|
||||
* The user agent string.
|
||||
*/
|
||||
agent: string;
|
||||
/**
|
||||
* The store region.
|
||||
*/
|
||||
storeRegion: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module Microsoft.Telemetry {
|
||||
export class Base {
|
||||
public baseType: string;
|
||||
constructor()
|
||||
class Base {
|
||||
baseType: string;
|
||||
constructor();
|
||||
}
|
||||
|
||||
class Envelope {
|
||||
public ver: number;
|
||||
public name: string;
|
||||
public time: string;
|
||||
public sampleRate: number;
|
||||
public seq: string;
|
||||
public iKey: string;
|
||||
public flags: number;
|
||||
public deviceId: string;
|
||||
public os: string;
|
||||
public osVer: string;
|
||||
public appId: string;
|
||||
public appVer: string;
|
||||
public userId: string;
|
||||
public tags: any;
|
||||
public data: Base;
|
||||
|
||||
|
||||
class Envelope {
|
||||
ver: number;
|
||||
name: string;
|
||||
time: string;
|
||||
sampleRate: number;
|
||||
seq: string;
|
||||
iKey: string;
|
||||
flags: number;
|
||||
deviceId: string;
|
||||
os: string;
|
||||
osVer: string;
|
||||
appId: string;
|
||||
appVer: string;
|
||||
userId: string;
|
||||
tags: any;
|
||||
data: Base;
|
||||
constructor();
|
||||
}
|
||||
}
|
||||
|
||||
declare module Microsoft.ApplicationInsights.Telemetry.Common {
|
||||
class Envelope extends Microsoft.Telemetry.Envelope {
|
||||
/**
|
||||
* The data contract for serializing this object.
|
||||
*/
|
||||
aiDataContract: any;
|
||||
|
||||
/**
|
||||
* Constructs a new instance of telemetry data.
|
||||
*/
|
||||
constructor(data: Microsoft.Telemetry.Base, name: string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module Microsoft.ApplicationInsights {
|
||||
|
||||
var Version: string;
|
||||
|
||||
interface IConfig {
|
||||
// The key of your Application Insights resource in Azure
|
||||
instrumentationKey: string;
|
||||
|
||||
// The Application Insights server
|
||||
endpointUrl: string;
|
||||
|
||||
emitLineDelimitedJson: boolean;
|
||||
|
||||
accountId: string;
|
||||
|
||||
// A session is logged if the user is inactive for this time in milliseconds. Default 30 mins.
|
||||
sessionRenewalMs: number;
|
||||
|
||||
// A session is logged if it has continued for this time in milliseconds. Default 24h.
|
||||
sessionExpirationMs: number;
|
||||
|
||||
//Default 100k
|
||||
maxBatchSizeInBytes: number;
|
||||
|
||||
// Default 15s
|
||||
maxBatchInterval: number;
|
||||
|
||||
// If true, data is sent immediately and not batched.
|
||||
enableDebug: boolean;
|
||||
|
||||
// If true, telemetry data is not collected or sent. Default false.
|
||||
disableTelemetry: boolean;
|
||||
|
||||
verboseLogging: boolean;
|
||||
|
||||
// Default 10s:
|
||||
diagnosticLogInterval: number;
|
||||
|
||||
samplingPercentage: number;
|
||||
|
||||
autoTrackPageVisitTime: boolean;
|
||||
|
||||
// If true, exceptions are not monitored.
|
||||
disableExceptionTracking: boolean;
|
||||
|
||||
// If true, ajax calls are not monitored.
|
||||
disableAjaxTracking: boolean;
|
||||
|
||||
// If true, default behavior of trackPageView is changed to record end of page view duration interval when
|
||||
// trackPageView is called. If false and no custom duration is provided to trackPageView, the page view
|
||||
// performance is calculated using the navigation timing API.
|
||||
overridePageViewDuration: boolean;
|
||||
|
||||
// Default 500 - controls how many ajax calls will be monitored per page view.
|
||||
// Set to -1 to monitor all ajax calls on the page.
|
||||
maxAjaxCallsPerView: number;
|
||||
|
||||
disableDataLossAnalysis: boolean;
|
||||
|
||||
disableCorrelationHeaders: boolean;
|
||||
|
||||
disableFlushOnBeforeUnload: boolean;
|
||||
|
||||
enableSessionStorageBuffer: boolean;
|
||||
|
||||
// Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
|
||||
cookieDomain: string;
|
||||
instrumentationKey?: string;
|
||||
endpointUrl?: string;
|
||||
emitLineDelimitedJson?: boolean;
|
||||
accountId?: string;
|
||||
sessionRenewalMs?: number;
|
||||
sessionExpirationMs?: number;
|
||||
maxBatchSizeInBytes?: number;
|
||||
maxBatchInterval?: number;
|
||||
enableDebug?: boolean;
|
||||
disableExceptionTracking?: boolean;
|
||||
disableTelemetry?: boolean;
|
||||
verboseLogging?: boolean;
|
||||
diagnosticLogInterval?: number;
|
||||
samplingPercentage?: number;
|
||||
autoTrackPageVisitTime?: boolean;
|
||||
disableAjaxTracking?: boolean;
|
||||
overridePageViewDuration?: boolean;
|
||||
maxAjaxCallsPerView?: number;
|
||||
disableDataLossAnalysis?: boolean;
|
||||
disableCorrelationHeaders?: boolean;
|
||||
disableFlushOnBeforeUnload?: boolean;
|
||||
enableSessionStorageBuffer?: boolean;
|
||||
cookieDomain?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
interface ISenderConfig {
|
||||
interface ITelemetryContext {
|
||||
/**
|
||||
* The url to which payloads will be sent
|
||||
*/
|
||||
endpointUrl: () => string;
|
||||
/**
|
||||
* The JSON format (normal vs line delimited). True means line delimited JSON.
|
||||
* The object describing a component tracked by this object.
|
||||
*/
|
||||
emitLineDelimitedJson: () => boolean;
|
||||
/**
|
||||
* The maximum size of a batch in bytes
|
||||
*/
|
||||
maxBatchSizeInBytes: () => number;
|
||||
/**
|
||||
* The maximum interval allowed between calls to batchInvoke
|
||||
*/
|
||||
maxBatchInterval: () => number;
|
||||
/**
|
||||
* The master off switch. Do not send any data if set to TRUE
|
||||
*/
|
||||
disableTelemetry: () => boolean;
|
||||
/**
|
||||
* Store a copy of a send buffer in the session storage
|
||||
*/
|
||||
enableSessionStorageBuffer: () => boolean;
|
||||
}
|
||||
|
||||
interface ITelemetryConfig extends ISenderConfig {
|
||||
instrumentationKey: () => string;
|
||||
accountId: () => string;
|
||||
sessionRenewalMs: () => number;
|
||||
sessionExpirationMs: () => number;
|
||||
sampleRate: () => number;
|
||||
endpointUrl: () => string;
|
||||
cookieDomain: () => string;
|
||||
}
|
||||
|
||||
|
||||
class TelemetryContext {
|
||||
/**
|
||||
* The object describing a component tracked by this object.
|
||||
*/
|
||||
application: Context.Application;
|
||||
|
||||
application: Context.IApplication;
|
||||
/**
|
||||
* The object describing a device tracked by this object.
|
||||
*/
|
||||
device: Context.Device;
|
||||
|
||||
device: Context.IDevice;
|
||||
/**
|
||||
* The object describing a user tracked by this object.
|
||||
*/
|
||||
user: Context.User;
|
||||
|
||||
/**
|
||||
* The object describing a session tracked by this object.
|
||||
*/
|
||||
session: Context.Session;
|
||||
|
||||
* The object describing internal settings.
|
||||
*/
|
||||
internal: Context.IInternal;
|
||||
/**
|
||||
* The object describing a location tracked by this object.
|
||||
*/
|
||||
location: Context.Location;
|
||||
|
||||
location: Context.ILocation;
|
||||
/**
|
||||
* The object describing a operation tracked by this object.
|
||||
*/
|
||||
operation: Context.Operation;
|
||||
|
||||
operation: Context.IOperation;
|
||||
/**
|
||||
* Use Sender.ts to send telemetry object to the endpoint
|
||||
* The object describing sampling settings.
|
||||
*/
|
||||
sample: Context.ISample;
|
||||
/**
|
||||
* The object describing a user tracked by this object.
|
||||
*/
|
||||
track(envelope: Telemetry.Common.Envelope): Telemetry.Common.Envelope;
|
||||
|
||||
user: Context.IUser;
|
||||
/**
|
||||
* The object describing a session tracked by this object.
|
||||
*/
|
||||
session: Context.ISession;
|
||||
/**
|
||||
* Adds telemetry initializer to the collection. Telemetry initializers will be called one by one
|
||||
* before telemetry item is pushed for sending and in the order they were added.
|
||||
*/
|
||||
addTelemetryInitializer(telemetryInitializer: (envelope: Telemetry.Common.Envelope) => boolean): void;
|
||||
addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.Telemetry.Envelope) => boolean): any;
|
||||
/**
|
||||
* Tracks telemetry object.
|
||||
*/
|
||||
track(envelope: Microsoft.Telemetry.Envelope): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main API that sends telemetry to Application Insights.
|
||||
* Learn more: http://go.microsoft.com/fwlink/?LinkID=401493
|
||||
*/
|
||||
class AppInsights {
|
||||
constructor(config: IConfig);
|
||||
|
||||
interface IAppInsights {
|
||||
config: IConfig;
|
||||
|
||||
context: TelemetryContext;
|
||||
|
||||
context: ITelemetryContext;
|
||||
queue: (() => void)[];
|
||||
/**
|
||||
* Starts timing how long the user views a page or other item. Call this when the page opens.
|
||||
* This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes.
|
||||
* @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.
|
||||
*/
|
||||
startTrackPage(name?: string): void;
|
||||
|
||||
* Starts timing how long the user views a page or other item. Call this when the page opens.
|
||||
* This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes.
|
||||
* @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.
|
||||
*/
|
||||
startTrackPage(name?: string): any;
|
||||
/**
|
||||
* Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes.
|
||||
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
|
||||
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
|
||||
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
stopTrackPage(name?: string, url?: string, properties?: Object, measurements?: Object): void;
|
||||
|
||||
* Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes.
|
||||
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
|
||||
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
|
||||
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
stopTrackPage(name?: string, url?: string, properties?: {
|
||||
[name: string]: string;
|
||||
}, measurements?: {
|
||||
[name: string]: number;
|
||||
}): any;
|
||||
/**
|
||||
* Logs that a page or other item was viewed.
|
||||
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
|
||||
@@ -404,39 +302,61 @@ declare module Microsoft.ApplicationInsights {
|
||||
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
* @param duration number - the number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally.
|
||||
*/
|
||||
trackPageView(name?: string, url?: string, properties?: Object, measurements?: Object, duration?: number): void;
|
||||
|
||||
trackPageView(name?: string, url?: string, properties?: {
|
||||
[name: string]: string;
|
||||
}, measurements?: {
|
||||
[name: string]: number;
|
||||
}, duration?: number): any;
|
||||
/**
|
||||
* Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends.
|
||||
* @param name A string that identifies this event uniquely within the document.
|
||||
*/
|
||||
startTrackEvent(name: string): void;
|
||||
|
||||
startTrackEvent(name: string): any;
|
||||
/**
|
||||
* Log an extended event that you started timing with {@link startTrackEvent}.
|
||||
* @param name The string you used to identify this event in startTrackEvent.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
stopTrackEvent(name: string, properties?: Object, measurements?: Object): void;
|
||||
|
||||
stopTrackEvent(name: string, properties?: {
|
||||
[name: string]: string;
|
||||
}, measurements?: {
|
||||
[name: string]: number;
|
||||
}): any;
|
||||
/**
|
||||
* Log a user action or other occurrence.
|
||||
* @param name A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackEvent(name: string, properties?: Object, measurements?: Object): void;
|
||||
|
||||
trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string): void;
|
||||
|
||||
* Log a user action or other occurrence.
|
||||
* @param name A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackEvent(name: string, properties?: {
|
||||
[name: string]: string;
|
||||
}, measurements?: {
|
||||
[name: string]: number;
|
||||
}): any;
|
||||
/**
|
||||
* Log an AJAX request
|
||||
* @param id Event id
|
||||
* @param absoluteUrl Full url
|
||||
* @param pathName Leave this parameter blank
|
||||
* @param totalTime Total time it took for AJAX request to complete
|
||||
* @param success Whether AJAX request succeeded or failed
|
||||
* @param resultCode Result code returned from AJAX call
|
||||
* @param method HTTP verb that was used (GET, POST)
|
||||
*/
|
||||
trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string): any;
|
||||
/**
|
||||
* Log an exception you have caught.
|
||||
* @param exception An Error from a catch clause, or the string error message.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
* @param severityLevel AI.SeverityLevel - severity level
|
||||
*/
|
||||
trackException(exception: Error, handledAt?: string, properties?: Object, measurements?: Object): void;
|
||||
trackException(exception: Error, handledAt?: string, properties?: {
|
||||
[name: string]: string;
|
||||
}, measurements?: {
|
||||
[name: string]: number;
|
||||
}, severityLevel?: AI.SeverityLevel): any;
|
||||
/**
|
||||
* Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
|
||||
* To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
|
||||
@@ -447,34 +367,34 @@ declare module Microsoft.ApplicationInsights {
|
||||
* @param min The smallest measurement in the sample. Defaults to the average.
|
||||
* @param max The largest measurement in the sample. Defaults to the average.
|
||||
*/
|
||||
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: Object): void;
|
||||
|
||||
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: {
|
||||
[name: string]: string;
|
||||
}): any;
|
||||
/**
|
||||
* Log a diagnostic message.
|
||||
* @param message A message string
|
||||
* @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty.
|
||||
*/
|
||||
trackTrace(message: string, properties?: Object): void;
|
||||
|
||||
trackTrace(message: string, properties?: {
|
||||
[name: string]: string;
|
||||
}): any;
|
||||
/**
|
||||
* Immediately send all queued telemetry.
|
||||
*/
|
||||
flush(): void;
|
||||
|
||||
flush(): any;
|
||||
/**
|
||||
* Sets the autheticated user id and the account id in this session.
|
||||
* User auth id and account id should be of type string. They should not contain commas, semi-colons, equal signs, spaces, or vertical-bars.
|
||||
*
|
||||
* @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.
|
||||
* @param accountId {string} - An optional string to represent the account associated with the authenticated user.
|
||||
*/
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): void;
|
||||
|
||||
* Sets the autheticated user id and the account id in this session.
|
||||
* User auth id and account id should be of type string. They should not contain commas, semi-colons, equal signs, spaces, or vertical-bars.
|
||||
*
|
||||
* @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.
|
||||
* @param accountId {string} - An optional string to represent the account associated with the authenticated user.
|
||||
*/
|
||||
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): any;
|
||||
/**
|
||||
* Clears the authenticated user id and the account id from the user context.
|
||||
*/
|
||||
clearAuthenticatedUserContext(): void;
|
||||
|
||||
clearAuthenticatedUserContext(): any;
|
||||
downloadAndSetup?(config: Microsoft.ApplicationInsights.IConfig): void;
|
||||
/**
|
||||
* The custom error handler for Application Insights
|
||||
* @param {string} message - The error message
|
||||
@@ -483,6 +403,6 @@ declare module Microsoft.ApplicationInsights {
|
||||
* @param {number} columnNumber - The column number for the line where the error was raised
|
||||
* @param {Error} error - The Error object
|
||||
*/
|
||||
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): void;
|
||||
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="base64-js.d.ts" />
|
||||
|
||||
import * as base64js from 'base64-js';
|
||||
|
||||
const bytes: Uint8Array = base64js.toByteArray('shemp');
|
||||
const decoded: string = base64js.fromByteArray(new Uint8Array(0));
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for base64-js v1.1.2
|
||||
// Project: https://github.com/beatgammit/base64-js
|
||||
// Definitions by: Peter Safranek <https://github.com/pe8ter>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'base64-js' {
|
||||
|
||||
export function toByteArray(encoded: string): Uint8Array;
|
||||
export function fromByteArray(bytes: Uint8Array): string;
|
||||
}
|
||||
Vendored
+8
@@ -174,6 +174,7 @@ declare namespace Microsoft.Maps {
|
||||
fixedMapPosition?: boolean;
|
||||
height?: number;
|
||||
inertiaIntensity?: number;
|
||||
navigationBarMode?: number;
|
||||
showBreadcrumb?: boolean;
|
||||
showCopyright?: boolean;
|
||||
showDashboard?: boolean;
|
||||
@@ -216,6 +217,12 @@ declare namespace Microsoft.Maps {
|
||||
getY(): number;
|
||||
}
|
||||
|
||||
export enum NavigationBarMode {
|
||||
default,
|
||||
compact,
|
||||
minified
|
||||
}
|
||||
|
||||
export enum PixelReference {
|
||||
control,
|
||||
page,
|
||||
@@ -307,6 +314,7 @@ declare namespace Microsoft.Maps {
|
||||
getZIndex(): number;
|
||||
setHtmlContent(content: string): void;
|
||||
setLocation(location: Location): void;
|
||||
setMap(map: Map): void;
|
||||
setOptions(options: InfoboxOptions): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -33,7 +33,7 @@ declare module "body-parser" {
|
||||
/**
|
||||
* passed to JSON.parse().
|
||||
*/
|
||||
receiver?: (key: string, value: any) => any;
|
||||
reviver?: (key: string, value: any) => any;
|
||||
/**
|
||||
* parse extended syntax with the qs module. (default: true)
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ declare module "body-parser" {
|
||||
/**
|
||||
* passed to JSON.parse().
|
||||
*/
|
||||
receiver?: (key: string, value: any) => any;
|
||||
reviver?: (key: string, value: any) => any;
|
||||
}): express.RequestHandler;
|
||||
|
||||
export function raw(options?: {
|
||||
|
||||
+6
-1
@@ -15,7 +15,7 @@
|
||||
* http://bootstrap-datepicker.readthedocs.org/en/release/options.html
|
||||
*/
|
||||
interface DatepickerOptions {
|
||||
format?: string;
|
||||
format?: string | DatepickerCustomFormatOptions;
|
||||
weekStart?: number;
|
||||
startDate?: any;
|
||||
endDate?: any;
|
||||
@@ -38,6 +38,11 @@ interface DatepickerOptions {
|
||||
assumeNearbyYear?: any;
|
||||
}
|
||||
|
||||
interface DatepickerCustomFormatOptions {
|
||||
toDisplay?(date: string, format: any, language: any): string;
|
||||
toValue?(date: string, format: any, language: any): Date;
|
||||
}
|
||||
|
||||
interface DatepickerEventObject extends JQueryEventObject {
|
||||
date: Date;
|
||||
format(format?: string): string;
|
||||
|
||||
@@ -44,3 +44,8 @@ $('.typeahead').typeahead({
|
||||
});
|
||||
|
||||
$('#navbar').affix();
|
||||
|
||||
$('.item').emulateTransitionEnd(2000);
|
||||
|
||||
$.support.transition = false;
|
||||
console.log(($.support.transition as TransitionEventNames).end === "transitionend");
|
||||
|
||||
Vendored
+11
-1
@@ -53,7 +53,7 @@ interface PopoverOptions {
|
||||
}
|
||||
|
||||
interface CollapseOptions {
|
||||
parent?: any;
|
||||
parent?: any;
|
||||
toggle?: boolean;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,10 @@ interface AffixOptions {
|
||||
target?: any;
|
||||
}
|
||||
|
||||
interface TransitionEventNames {
|
||||
end: string;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
modal(options?: ModalOptions): JQuery;
|
||||
modal(options?: ModalOptionsBackdropString): JQuery;
|
||||
@@ -114,6 +118,12 @@ interface JQuery {
|
||||
typeahead(options?: TypeaheadOptions): JQuery;
|
||||
|
||||
affix(options?: AffixOptions): JQuery;
|
||||
|
||||
emulateTransitionEnd(duration: number): JQuery;
|
||||
}
|
||||
|
||||
interface JQuerySupport {
|
||||
transition: boolean | TransitionEventNames;
|
||||
}
|
||||
|
||||
declare module "bootstrap" {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference path="browser-pack.d.ts" />
|
||||
|
||||
import browserPack = require("browser-pack");
|
||||
|
||||
module BrowserPackTest {
|
||||
|
||||
export function packIt(opts?: BrowserPack.Options) {
|
||||
var packOpts: BrowserPack.Options = {
|
||||
basedir: opts.basedir || "./",
|
||||
externalRequireName: opts.externalRequireName || "require",
|
||||
hasExports: opts.hasExports || false,
|
||||
prelude: opts.prelude || undefined,
|
||||
preludePath: opts.preludePath || undefined,
|
||||
raw: opts.raw || false,
|
||||
sourceMapPrefix: opts.sourceMapPrefix || '//#',
|
||||
standalone: opts.standalone || undefined,
|
||||
standaloneModule: opts.standaloneModule || undefined,
|
||||
};
|
||||
|
||||
var res = browserPack(); // 'opts' are optional
|
||||
var res2 = browserPack(packOpts);
|
||||
|
||||
// ensure return value is a stream
|
||||
var res3 = res.pipe(res2);
|
||||
|
||||
res.on("error", function (err: any) {
|
||||
console.error("browser-pack error: ", err);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export = BrowserPackTest;
|
||||
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
// Type definitions for browser-pack v6.0.1
|
||||
// Project: https://github.com/substack/browser-pack
|
||||
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
/** pack node-style source files from a json stream into a browser bundle
|
||||
*/
|
||||
declare module BrowserPack {
|
||||
|
||||
export interface Options {
|
||||
/** Whether the bundle should include require= (or the opts.externalRequireName) so that
|
||||
* require() is available outside the bundle
|
||||
*/
|
||||
hasExports?: boolean;
|
||||
|
||||
/** A string to use in place of 'require' if opts.hasExports is specified, default is 'require'
|
||||
*/
|
||||
externalRequireName?: string;
|
||||
|
||||
/** Specify a custom prelude, but know what you're doing first. See the prelude.js file in
|
||||
* this repo for the default prelude. If you specify a custom prelude, you must also specify
|
||||
* a valid opts.preludePath to the prelude source file for sourcemaps to work
|
||||
*/
|
||||
prelude?: string;
|
||||
|
||||
/** prelude.js path if a custom opts.prelude is specified
|
||||
*/
|
||||
preludePath?: string;
|
||||
|
||||
/** Used if opts.preludePath is undefined, this is used to resolve the prelude.js file location, default: 'process.cwd()'
|
||||
*/
|
||||
basedir?: string;
|
||||
|
||||
/** if given, the writable end of the stream will expect objects to be written to
|
||||
* it instead of expecting a stream of json text it will need to parse, default false
|
||||
*/
|
||||
raw?: boolean;
|
||||
|
||||
/** External string name to use for UMD, if not provided, UMD declaration is not wrapped around output
|
||||
*/
|
||||
standalone?: string;
|
||||
|
||||
/** Sets the internal module name to export for standalone
|
||||
*/
|
||||
standaloneModule?: string;
|
||||
|
||||
/** If given and source maps are computed, the opts.sourceMapPrefix string will be used instead of default: '//#'
|
||||
*/
|
||||
sourceMapPrefix?: string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "browser-pack" {
|
||||
/** pack node-style source files from a json stream into a browser bundle
|
||||
*/
|
||||
function browserPack(opts?: BrowserPack.Options): NodeJS.ReadWriteStream;
|
||||
export = browserPack;
|
||||
}
|
||||
Vendored
+1
-1
@@ -105,7 +105,7 @@ declare namespace Chartist {
|
||||
plugins?: Array<any>; // all of these plugins seem to be functions with options, but keeping type any for now
|
||||
|
||||
update(data: Object, options?: T, override?: boolean): void;
|
||||
detatch(): void;
|
||||
detach(): void;
|
||||
|
||||
/**
|
||||
* Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
|
||||
|
||||
Vendored
+1
-1
@@ -641,7 +641,7 @@ declare namespace CKEDITOR {
|
||||
filebrowserImageBrowseLinkUrl?: string;
|
||||
filebrowserImageBrowseUrl?: string;
|
||||
filebrowserImageUploadUrl?: string;
|
||||
filebrowserUploadUr?: string;
|
||||
filebrowserUploadUrl?: string;
|
||||
filebrowserWindowFeatures?: string;
|
||||
filebrowserWindowHeight?: number | string;
|
||||
filebrowserWindowWidth?: number | string;
|
||||
|
||||
Vendored
+10
-8
@@ -220,14 +220,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area,
|
||||
and the size of the visible area(minus scrollbars). */
|
||||
getScrollInfo(): {
|
||||
left: any;
|
||||
top: any;
|
||||
width: any;
|
||||
height: any;
|
||||
clientWidth: any;
|
||||
clientHeight: any;
|
||||
}
|
||||
getScrollInfo(): CodeMirror.ScrollInfo;
|
||||
|
||||
/** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor.
|
||||
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
|
||||
@@ -609,6 +602,15 @@ declare namespace CodeMirror {
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface ScrollInfo {
|
||||
left: any;
|
||||
top: any;
|
||||
width: any;
|
||||
height: any;
|
||||
clientWidth: any;
|
||||
clientHeight: any;
|
||||
}
|
||||
|
||||
interface TextMarker {
|
||||
/** Remove the mark. */
|
||||
clear(): void;
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
/// <reference path="common-tags.d.ts" />
|
||||
|
||||
import * as commonTags from 'common-tags';
|
||||
|
||||
/* Test Built-in Tags */
|
||||
|
||||
commonTags.commaLists `
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.commaListsAnd`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.commaListsOr`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
let fruits = ['apple', 'orange', 'watermelon'];
|
||||
|
||||
commonTags.html`
|
||||
<div class="list">
|
||||
<ul>
|
||||
${fruits.map(fruit => `<li>${fruit}</li>`)}
|
||||
${'<li>kiwi</li>\n<li>guava</li>'}
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
|
||||
commonTags.codeBlock`
|
||||
<div class="list">
|
||||
<ul>
|
||||
${fruits.map(fruit => `<li>${fruit}</li>`)}
|
||||
${'<li>kiwi</li>\n<li>guava</li>'}
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
|
||||
commonTags.source`
|
||||
<div class="list">
|
||||
<ul>
|
||||
${fruits.map(fruit => `<li>${fruit}</li>`)}
|
||||
${'<li>kiwi</li>\n<li>guava</li>'}
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
|
||||
commonTags.oneLine`
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
`;
|
||||
|
||||
commonTags.oneLineTrim`
|
||||
https://news.com/article
|
||||
?utm_source=designernews.co
|
||||
`;
|
||||
|
||||
commonTags.oneLineCommaLists`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.oneLineCommaListsOr`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.oneLineCommaListsAnd`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.inlineLists`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
commonTags.oneLineInlineLists`
|
||||
I like ${['apples', 'bananas', 'watermelons']}
|
||||
They're good!
|
||||
`;
|
||||
|
||||
let verb = 'notice';
|
||||
|
||||
commonTags.stripIndent`
|
||||
This is a multi-line string.
|
||||
You'll ${verb} that it is indented.
|
||||
We don't want to output this indentation.
|
||||
But we do want to keep this line indented.
|
||||
`;
|
||||
|
||||
commonTags.stripIndents`
|
||||
This is a multi-line string.
|
||||
You'll ${verb} that it is indented.
|
||||
We don't want to output this indentation.
|
||||
We don't want to keep this line indented either.
|
||||
`;
|
||||
|
||||
/* Test Tag Constructor */
|
||||
|
||||
new commonTags.TemplateTag();
|
||||
|
||||
const substitutionReplacer = (oldValue : string, newValue : string) => ({
|
||||
onSubstitution(substitution : string, resultSoFar : string) {
|
||||
if (substitution === oldValue) {
|
||||
return newValue;
|
||||
}
|
||||
return substitution;
|
||||
}
|
||||
});
|
||||
|
||||
new commonTags.TemplateTag(substitutionReplacer('fizz', 'buzz'));
|
||||
|
||||
new commonTags.TemplateTag(
|
||||
substitutionReplacer('fizz', 'buzz'),
|
||||
substitutionReplacer('foo', 'bar')
|
||||
);
|
||||
|
||||
new commonTags.TemplateTag([
|
||||
substitutionReplacer('fizz', 'buzz'),
|
||||
substitutionReplacer('foo', 'bar')
|
||||
]);
|
||||
|
||||
new commonTags.TemplateTag({});
|
||||
|
||||
new commonTags.TemplateTag({
|
||||
onEndResult: endResult => `${endResult}!`
|
||||
});
|
||||
|
||||
new commonTags.TemplateTag({
|
||||
onSubstitution: substitution => `${substitution}!`,
|
||||
onEndResult: endResult => `${endResult}!`
|
||||
});
|
||||
|
||||
/* Tests Built-in Transformers */
|
||||
|
||||
new commonTags.TemplateTag(commonTags.trimResultTransformer());
|
||||
new commonTags.TemplateTag(commonTags.trimResultTransformer('left'));
|
||||
new commonTags.TemplateTag(commonTags.trimResultTransformer('right'));
|
||||
|
||||
new commonTags.TemplateTag(commonTags.stripIndentTransformer());
|
||||
new commonTags.TemplateTag(commonTags.stripIndentTransformer('initial'));
|
||||
new commonTags.TemplateTag(commonTags.stripIndentTransformer('all'));
|
||||
|
||||
new commonTags.TemplateTag(commonTags.replaceResultTransformer('foo', 'bar'));
|
||||
|
||||
new commonTags.TemplateTag(commonTags.inlineArrayTransformer());
|
||||
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({}));
|
||||
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({separator: 'foo'}));
|
||||
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({conjunction: 'bar'}));
|
||||
|
||||
new commonTags.TemplateTag(commonTags.splitStringTransformer('foo'));
|
||||
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
// Type definitions for common-tags v1.2.1
|
||||
// Project: https://github.com/declandewet/common-tags
|
||||
// Definitions by: Viktor Zozuliak <https://github.com/zuzusik>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'common-tags' {
|
||||
type TemplateTag = (literals: string[], ...placeholders: any[]) => string;
|
||||
|
||||
type TemplateTransformer = {
|
||||
onSubstitution?: (substitution: string, resultSoFar: string) => string;
|
||||
onEndResult?: (endResult : string) => string;
|
||||
}
|
||||
|
||||
/* Built-in Tags */
|
||||
export var commaLists: TemplateTag;
|
||||
|
||||
export var commaListsAnd: TemplateTag;
|
||||
|
||||
export var commaListsOr: TemplateTag;
|
||||
|
||||
export var html: TemplateTag;
|
||||
|
||||
export var codeBlock: TemplateTag;
|
||||
|
||||
export var source: TemplateTag;
|
||||
|
||||
export var oneLine: TemplateTag;
|
||||
|
||||
export var oneLineTrim: TemplateTag;
|
||||
|
||||
export var oneLineCommaLists: TemplateTag;
|
||||
|
||||
export var oneLineCommaListsOr: TemplateTag;
|
||||
|
||||
export var oneLineCommaListsAnd: TemplateTag;
|
||||
|
||||
export var inlineLists: TemplateTag;
|
||||
|
||||
export var oneLineInlineLists: TemplateTag;
|
||||
|
||||
export var stripIndent: TemplateTag;
|
||||
|
||||
export var stripIndents: TemplateTag;
|
||||
|
||||
/* New Tag Constructor */
|
||||
export var TemplateTag: {
|
||||
new(): TemplateTag;
|
||||
new(...transformers: TemplateTransformer[]): TemplateTag;
|
||||
new(transformers: TemplateTransformer[]): TemplateTag;
|
||||
};
|
||||
|
||||
/* Built-in Transformers */
|
||||
export var trimResultTransformer: (side?: 'left'|'right') => TemplateTransformer;
|
||||
|
||||
export var stripIndentTransformer: (type?: 'initial'|'all') => TemplateTransformer;
|
||||
|
||||
export var replaceResultTransformer: (replaceWhat: string, replaceWith: string) => TemplateTransformer;
|
||||
|
||||
export var inlineArrayTransformer: (opts?: {separator?: string, conjunction?: string}) => TemplateTransformer;
|
||||
|
||||
export var splitStringTransformer: (splitBy: string) => TemplateTransformer;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/// <reference path='../node/node.d.ts' /> // only for require
|
||||
/// <reference path='component-emitter.d.ts' />
|
||||
// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016
|
||||
|
||||
|
||||
// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016
|
||||
|
||||
var Emitter = require('component-emitter');
|
||||
var emitter = new Emitter;
|
||||
emitter.emit('something');
|
||||
|
||||
|
||||
|
||||
|
||||
var user = { name: 'tobi' };
|
||||
Emitter(user);
|
||||
|
||||
(<Emitter>user).emit('im a user');
|
||||
|
||||
|
||||
|
||||
// this example modified from the one on https://www.npmjs.com/package/component-emitter
|
||||
var User = Object.create({
|
||||
someUserFunction: () => {console.log('someUserFunction called!')}
|
||||
})
|
||||
var another_user = Emitter(User);
|
||||
another_user.someUserFunction()
|
||||
another_user.on('hi', () => {console.log('Hi called')})
|
||||
another_user.emit('hi')
|
||||
|
||||
|
||||
// Additional sample code for this test
|
||||
function handleSomeRecurringEvent(event_data: any) {
|
||||
console.log('handle some-recurring-event')
|
||||
}
|
||||
emitter.on('some-recurring-event', handleSomeRecurringEvent)
|
||||
|
||||
|
||||
emitter.once('some-single-shot-event', (event_data: any) => {console.log('handle some-single-shot-event')})
|
||||
|
||||
|
||||
emitter.off()
|
||||
emitter.off('some-recurring-event')
|
||||
emitter.off('some-recurring-event', handleSomeRecurringEvent)
|
||||
|
||||
var event_data = {some: 'data'}
|
||||
emitter.emit('some-recurring-event')
|
||||
emitter.emit('some-recurring-event', event_data)
|
||||
|
||||
emitter.listeners('some-recurring-event')
|
||||
|
||||
emitter.hasListeners('some-recurring-event')
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for component-emitter v1.2.1
|
||||
// Project: https://www.npmjs.com/package/component-emitter
|
||||
// Definitions by: Peter Snider <https://github.com/psnider/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/emitter-component
|
||||
|
||||
|
||||
interface Emitter {
|
||||
(obj?: Object): Emitter;
|
||||
on(event: string, listener: Function): Emitter;
|
||||
once(event: string, listener: Function): Emitter;
|
||||
off(event?: string, listener?: Function): Emitter;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
listeners(event: string): Function[];
|
||||
hasListeners(event: string): boolean;
|
||||
}
|
||||
|
||||
declare module 'component-emitter' {
|
||||
var Emitter: Emitter;
|
||||
}
|
||||
Vendored
+14
-2
@@ -29,8 +29,20 @@ declare namespace cucumber {
|
||||
}
|
||||
|
||||
interface HookScenario{
|
||||
attach(text: string, mimeType?: string, callback?: (err?:any) => void): void;
|
||||
isFailed() : boolean;
|
||||
getKeyword():string;
|
||||
getName():string;
|
||||
getDescription():string;
|
||||
getUri():string;
|
||||
getLine():number;
|
||||
getTags():string[];
|
||||
getException():Error;
|
||||
getAttachments():any[];
|
||||
attach(data:any, mimeType?:string, callback?:(err?:any) => void):void;
|
||||
isSuccessful():boolean;
|
||||
isFailed():boolean;
|
||||
isPending():boolean;
|
||||
isUndefined():boolean;
|
||||
isSkipped():boolean;
|
||||
}
|
||||
|
||||
interface HookCode {
|
||||
|
||||
Vendored
+9
-8
@@ -292,17 +292,17 @@ declare namespace d3 {
|
||||
*/
|
||||
datum(): Datum;
|
||||
|
||||
/**
|
||||
* Set the data item for each node in the selection.
|
||||
* @param value the constant element to use for each node
|
||||
*/
|
||||
datum<NewDatum>(value: NewDatum): Update<NewDatum>;
|
||||
|
||||
/**
|
||||
* Derive the data item for each node in the selection. Useful for situations such as the HTML5 'dataset' attribute.
|
||||
* @param value the function to compute data for each node
|
||||
*/
|
||||
datum<NewDatum>(value: (datum: Datum, index: number, outerIndex: number) => NewDatum): Update<NewDatum>;
|
||||
|
||||
/**
|
||||
* Set the data item for each node in the selection.
|
||||
* @param value the constant element to use for each node
|
||||
*/
|
||||
datum<NewDatum>(value: NewDatum): Update<NewDatum>;
|
||||
|
||||
/**
|
||||
* Reorders nodes in the selection based on the given comparator. Nodes are re-inserted into the document once sorted.
|
||||
@@ -1111,8 +1111,7 @@ declare namespace d3 {
|
||||
export function deviation(array: number[]): number;
|
||||
export function deviation<T>(array: T[], accessor: (datum: T, index: number) => number): number;
|
||||
|
||||
export function bisectLeft(array: number[], x: number, lo?: number, hi?: number): number;
|
||||
export function bisectLeft(array: string[], x: string, lo?: number, hi?: number): number;
|
||||
export function bisectLeft<T>(array: T[], x: T, lo?: number, hi?: number): number;
|
||||
|
||||
export var bisect: typeof bisectRight;
|
||||
|
||||
@@ -3064,6 +3063,8 @@ declare namespace d3 {
|
||||
}
|
||||
|
||||
export interface Partition<T extends partition.Node> {
|
||||
(root: T): T[];
|
||||
|
||||
nodes(root: T): T[];
|
||||
|
||||
links(nodes: T[]): partition.Link<T>[];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+155
@@ -0,0 +1,155 @@
|
||||
// Type definitions for d3Kit v1.1.0
|
||||
// Project: https://www.npmjs.com/package/d3kit
|
||||
// Definitions by: Morgan Benton <https://github.com/morphatic/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../d3/d3.d.ts" />
|
||||
|
||||
declare namespace d3kit {
|
||||
|
||||
export interface ChartMargin {
|
||||
top?: number;
|
||||
right?: number;
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
}
|
||||
|
||||
export interface ChartOptions {
|
||||
margin?: ChartMargin;
|
||||
offset?: [number,number];
|
||||
initialWidth?: number;
|
||||
initialHeight?: number;
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
export interface ChartMixin {
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
export class Skeleton {
|
||||
|
||||
constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array<string>);
|
||||
|
||||
// Getters
|
||||
getCustomEventNames(): Array<string>;
|
||||
getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events
|
||||
getInnerWidth(): number;
|
||||
getInnerHeight(): number;
|
||||
getLayerOrganizer(): LayerOrganizer;
|
||||
getRootG(): d3.Selection<any>;
|
||||
getSvg(): d3.Selection<any>;
|
||||
|
||||
// Getter/Setters
|
||||
data(): any;
|
||||
data(data?: any, doNotDispatch?: boolean): Skeleton;
|
||||
options(): any; // wish this could be ChartOptions
|
||||
options(options: ChartOptions, doNotDispatch?: boolean): Skeleton;
|
||||
margin(): ChartMargin;
|
||||
margin(margin: ChartMargin, doNotDispatch?: boolean): Skeleton;
|
||||
offset(): [number, number];
|
||||
offset(offset: Array<number>, doNotDispatch?: boolean): Skeleton;
|
||||
width(): number;
|
||||
width(value: number|string, doNotDispatch?: boolean): Skeleton;
|
||||
height(): number;
|
||||
height(value: number|string, doNotDispatch?: boolean): Skeleton;
|
||||
dimension(): [number, number];
|
||||
dimension(dimension: [number|string, number|string], doNotDispatch?: boolean): Skeleton;
|
||||
autoResize(mode?: string|boolean): string|boolean|void;
|
||||
autoResizeDetection(method?:string): string|void;
|
||||
autoResizeToAspectRatio(ratio?: number|boolean): number|boolean|void;
|
||||
|
||||
// Other functions
|
||||
on(eventName: string, listener: (...args: Array<any>) => void): void;
|
||||
hasData(): boolean;
|
||||
hasNonZeroArea(): boolean;
|
||||
mixin(fn: ChartMixin): void;
|
||||
resizeToFitContainer(mode: string|boolean, doNotDispatch?: boolean): void;
|
||||
resizeToAspectRatio(ratio: number, doNotDispatch?: boolean): void;
|
||||
}
|
||||
|
||||
interface ChartletPropertyCallback {
|
||||
(datum?: any, datum_index?: number): any;
|
||||
}
|
||||
|
||||
export interface ChartletEventFunction {
|
||||
(sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
|
||||
}
|
||||
|
||||
export class Chartlet {
|
||||
|
||||
constructor(
|
||||
enterFunction?: ChartletEventFunction,
|
||||
updateFunction?: ChartletEventFunction,
|
||||
exitFunction?: ChartletEventFunction,
|
||||
customEventName?: Array<string>);
|
||||
|
||||
// Getter functions
|
||||
getDispatcher(): d3.Dispatch;
|
||||
getCustomEventNames(): Array<string>;
|
||||
getPropertyValue(name: string, datum: any, datum_index: number): any;
|
||||
|
||||
// Getter/Setter functions
|
||||
property(name: string): ChartletPropertyCallback;
|
||||
property(name: string, value: any): Chartlet;
|
||||
|
||||
// Enter/Update/Exit functions
|
||||
enter( sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
|
||||
update(sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
|
||||
exit( sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
|
||||
|
||||
// Inheritance functions
|
||||
inheritPropertyFrom(parent_chartlet: Chartlet, parent_property_name: string, child_property_name?: string): void;
|
||||
inheritPropertiesFrom(parent_chartlet: Chartlet, parent_property_names: Array<string>, child_property_names?: Array<string>): void;
|
||||
publishEventsTo(dispatcher: d3.Dispatch): Chartlet;
|
||||
|
||||
// Events
|
||||
on(eventName: string, handlerFunction: ChartletEventFunction): void;
|
||||
}
|
||||
|
||||
interface LayerConfig {
|
||||
name?: string,
|
||||
names?: Array<string>,
|
||||
sublayers?: LayerConfig
|
||||
}
|
||||
|
||||
export class LayerOrganizer {
|
||||
|
||||
constructor(container: d3.Selection<any>, tag?: string);
|
||||
|
||||
create(config: string|Array<string>|LayerConfig|Array<LayerConfig>): d3.Selection<any>|Array<d3.Selection<any>>;
|
||||
get(name: string): d3.Selection<any>;
|
||||
has(name: string): boolean;
|
||||
}
|
||||
|
||||
export namespace factory {
|
||||
export function createChart(
|
||||
defaultOptions: ChartOptions,
|
||||
customEvents: Array<string>,
|
||||
constructor: (skeleton: Skeleton) => void
|
||||
): (selector: string|Element, options?: ChartOptions, customEvents?: Array<string>) => Skeleton;
|
||||
}
|
||||
|
||||
export namespace helper {
|
||||
export function debounce(fn: (...args: Array<any>) => void, wait: number, immediate: boolean): (...args: Array<any>) => void;
|
||||
export function extend(target: Object, ...args: Object[]): Object;
|
||||
export function deepExtend(target: Object, ...args: Object[]): Object;
|
||||
export function bindMouseEventsToDispatcher(selection: d3.Selection<any>, dispatch: d3.Dispatch, prefix: string): void;
|
||||
export function removeAllChildren(selection: d3.Selection<any>, noTransition: boolean): d3.Selection<any>;
|
||||
export function on(element: Element, type: string, listener: (...args: Array<any>) => void): void;
|
||||
export function off(element: Element, type: string, listener: (...args: Array<any>) => void): void;
|
||||
export function trim(str: string, characters: string): string;
|
||||
export function dasherize(str: string): string;
|
||||
export function $(s: Element|string): Element;
|
||||
export function $$(s: Array<Node>|NodeList): Array<Element>;
|
||||
export function isArray(value: any): boolean;
|
||||
export function isNumber(value: any): boolean;
|
||||
export function isObject(value: any): boolean;
|
||||
export function isElement(o: any): boolean;
|
||||
export function isFunction(functionToCheck: any): boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module 'd3kit' {
|
||||
export = d3kit;
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
/// <reference path='d3pie.d.ts' />
|
||||
|
||||
let chart = new d3pie('test',
|
||||
{
|
||||
header: {
|
||||
title: {
|
||||
text: '',
|
||||
color: '#333333',
|
||||
fontSize: 18,
|
||||
font: 'arial'
|
||||
},
|
||||
subtitle: {
|
||||
color: '#666666',
|
||||
fontSize: 14,
|
||||
font: 'arial'
|
||||
},
|
||||
location: 'top-center',
|
||||
titleSubtitlePadding: 8
|
||||
},
|
||||
footer: {
|
||||
text: '',
|
||||
color: '#666666',
|
||||
fontSize: 14,
|
||||
font: 'arial',
|
||||
location: 'left'
|
||||
},
|
||||
size: {
|
||||
canvasHeight: 500,
|
||||
canvasWidth: 500,
|
||||
pieInnerRadius: 0,
|
||||
pieOuterRadius: null
|
||||
},
|
||||
data: {
|
||||
sortOrder: 'none',
|
||||
smallSegmentGrouping: {
|
||||
enabled: false,
|
||||
value: 1,
|
||||
valueType: 'percentage',
|
||||
label: 'Other',
|
||||
color: '#cccccc'
|
||||
},
|
||||
content: []
|
||||
},
|
||||
labels: {
|
||||
outer: {
|
||||
format: 'label',
|
||||
hideWhenLessThanPercentage: null,
|
||||
pieDistance: 30
|
||||
},
|
||||
inner: {
|
||||
format: 'percentage',
|
||||
hideWhenLessThanPercentage: null
|
||||
},
|
||||
mainLabel: {
|
||||
color: '#333333',
|
||||
font: 'arial',
|
||||
fontSize: 10
|
||||
},
|
||||
percentage: {
|
||||
color: '#dddddd',
|
||||
font: 'arial',
|
||||
fontSize: 10,
|
||||
decimalPlaces: 0
|
||||
},
|
||||
value: {
|
||||
color: '#cccc44',
|
||||
font: 'arial',
|
||||
fontSize: 10
|
||||
},
|
||||
lines: {
|
||||
enabled: true,
|
||||
style: 'curved',
|
||||
color: 'segment' // 'segment' or a hex color
|
||||
}
|
||||
},
|
||||
effects: {
|
||||
load: {
|
||||
effect: 'default', // none / default
|
||||
speed: 1000
|
||||
},
|
||||
pullOutSegmentOnClick: {
|
||||
effect: 'bounce', // none / linear / bounce / elastic / back
|
||||
speed: 300,
|
||||
size: 10
|
||||
},
|
||||
highlightSegmentOnMouseover: true,
|
||||
highlightLuminosity: -0.2
|
||||
},
|
||||
tooltips: {
|
||||
enabled: false,
|
||||
type: 'placeholder', // caption|placeholder
|
||||
string: '',
|
||||
placeholderParser: null,
|
||||
styles: {
|
||||
fadeInSpeed: 250,
|
||||
backgroundColor: '#000000',
|
||||
backgroundOpacity: 0.5,
|
||||
color: '#efefef',
|
||||
borderRadius: 2,
|
||||
font: 'arial',
|
||||
fontSize: 10,
|
||||
padding: 4
|
||||
}
|
||||
},
|
||||
|
||||
misc: {
|
||||
colors: {
|
||||
background: null, // transparent
|
||||
segments: [
|
||||
'#2484c1', '#65a620', '#7b6888', '#a05d56', '#961a1a',
|
||||
'#d8d23a', '#e98125', '#d0743c', '#635222', '#6ada6a',
|
||||
'#0c6197', '#7d9058', '#207f33', '#44b9b0', '#bca44a',
|
||||
'#e4a14b', '#a3acb2', '#8cc3e9', '#69a6f9', '#5b388f',
|
||||
'#546e91', '#8bde95', '#d2ab58', '#273c71', '#98bf6e',
|
||||
'#4daa4b', '#98abc5', '#cc1010', '#31383b', '#006391',
|
||||
'#c2643f', '#b0a474', '#a5a39c', '#a9c2bc', '#22af8c',
|
||||
'#7fcecf', '#987ac6', '#3d3b87', '#b77b1c', '#c9c2b6',
|
||||
'#807ece', '#8db27c', '#be66a2', '#9ed3c6', '#00644b',
|
||||
'#005064', '#77979f', '#77e079', '#9c73ab', '#1f79a7'
|
||||
],
|
||||
segmentStroke: '#ffffff'
|
||||
},
|
||||
gradient: {
|
||||
enabled: false,
|
||||
percentage: 95,
|
||||
color: '#000000'
|
||||
},
|
||||
canvasPadding: {
|
||||
top: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
left: 5
|
||||
},
|
||||
pieCenterOffset: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
cssPrefix: null
|
||||
},
|
||||
callbacks: {
|
||||
onload: null,
|
||||
onMouseoverSegment: null,
|
||||
onMouseoutSegment: null,
|
||||
onClickSegment: null
|
||||
}
|
||||
})
|
||||
Vendored
+146
@@ -0,0 +1,146 @@
|
||||
// Type definitions for d3pie 0.1.9
|
||||
// Project: https://github.com/benkeen/d3pie
|
||||
// Definitions by: Petryshyn Sergii <https://github.com/mc-petry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace d3pie {
|
||||
interface ID3PieChart {
|
||||
redraw(): void
|
||||
openSegment(index: number): void
|
||||
closeSegment(index: void): void
|
||||
getOpenSegment(): any
|
||||
updateProp(propKey: string, value: any): void
|
||||
destroy(): void
|
||||
}
|
||||
|
||||
interface ID3PieStyleOptions {
|
||||
color?: string
|
||||
fontSize?: number
|
||||
font?: string
|
||||
}
|
||||
|
||||
interface ID3PieTextOptions extends ID3PieStyleOptions {
|
||||
text?: string
|
||||
}
|
||||
|
||||
interface ID3PieLabelsOptions {
|
||||
format?: 'label' | 'value' | 'percentage' | 'label-value1' | 'label-value2' | 'label-percentage1' | 'label-percentage2'
|
||||
hideWhenLessThanPercentage?: number
|
||||
}
|
||||
|
||||
interface ID3PieOptions {
|
||||
header?: {
|
||||
title?: ID3PieTextOptions
|
||||
subtitle?: ID3PieTextOptions
|
||||
location?: 'top-center' | 'top-left' | 'pie-center'
|
||||
titleSubtitlePadding?: number
|
||||
}
|
||||
footer?: { location?: 'left' } & ID3PieTextOptions
|
||||
size?: {
|
||||
canvasHeight?: number
|
||||
canvasWidth?: number
|
||||
pieOuterRadius?: string | number
|
||||
pieInnerRadius?: string | number
|
||||
}
|
||||
data: {
|
||||
sortOrder?: 'none' | 'random' | 'value-asc' | 'value-desc' | 'label-asc' | 'label-desc'
|
||||
smallSegmentGrouping?: {
|
||||
enabled?: boolean
|
||||
value?: number
|
||||
valueType?: 'percentage' | 'value'
|
||||
label?: string
|
||||
color?: string
|
||||
}
|
||||
content: {
|
||||
label: string
|
||||
value: number
|
||||
color?: string
|
||||
}[]
|
||||
}
|
||||
labels?: {
|
||||
outer?: { pieDistance?: number } & ID3PieLabelsOptions
|
||||
inner?: ID3PieLabelsOptions
|
||||
mainLabel?: ID3PieStyleOptions
|
||||
percentage?: { decimalPlaces?: number } & ID3PieStyleOptions
|
||||
value?: ID3PieStyleOptions
|
||||
lines?: {
|
||||
enabled?: boolean
|
||||
style?: 'curved' | 'straight'
|
||||
color?: string
|
||||
}
|
||||
truncation?: {
|
||||
enabled?: boolean
|
||||
truncateLength?: number
|
||||
}
|
||||
formatter?: (context: {
|
||||
section: 'outer' | 'inner'
|
||||
value: number
|
||||
label: string
|
||||
}) => string
|
||||
}
|
||||
effects?: {
|
||||
load?: {
|
||||
effect?: 'none' | 'default'
|
||||
speed?: number
|
||||
}
|
||||
pullOutSegmentOnClick?: {
|
||||
effect?: 'none' | 'linear' | 'bounce' | 'elastic' | 'back'
|
||||
speed?: number
|
||||
size?: number
|
||||
}
|
||||
highlightSegmentOnMouseover?: boolean
|
||||
highlightLuminosity?: number
|
||||
}
|
||||
tooltips?: {
|
||||
enabled?: boolean
|
||||
type?: 'placeholder' | 'caption'
|
||||
string?: string
|
||||
placeholderParser?: (index: number, data: { label?: string, percentage?: number, value?: number }) => void
|
||||
styles?: {
|
||||
fadeInSpeed?: number
|
||||
backgroundColor?: string
|
||||
backgroundOpacity?: number
|
||||
color?: string
|
||||
borderRadius?: number
|
||||
font?: string
|
||||
fontSize?: number
|
||||
padding?: number
|
||||
}
|
||||
}
|
||||
misc?: {
|
||||
colors?: {
|
||||
background?: string
|
||||
segments?: string[]
|
||||
segmentStroke?: string
|
||||
}
|
||||
gradient?: {
|
||||
enabled?: boolean
|
||||
percentage?: number
|
||||
color?: string
|
||||
}
|
||||
canvasPadding?: {
|
||||
top?: number
|
||||
right?: number
|
||||
bottom?: number
|
||||
left?: number
|
||||
}
|
||||
pieCenterOffset?: {
|
||||
x?: number
|
||||
y?: number
|
||||
}
|
||||
cssPrefix?: string
|
||||
}
|
||||
callbacks?: {
|
||||
onload?: Function
|
||||
onMouseoverSegment?: Function
|
||||
onMouseoutSegment?: Function
|
||||
onClickSegment?: Function
|
||||
}
|
||||
}
|
||||
|
||||
interface ID3PieClass {
|
||||
new (id: string | HTMLElement, options: ID3PieOptions): ID3PieChart
|
||||
}
|
||||
}
|
||||
|
||||
declare const d3pie: d3pie.ID3PieClass
|
||||
@@ -11,6 +11,9 @@ namespace DagreD3Tests {
|
||||
|
||||
predecessors["a"] = graph.predecessors("a");
|
||||
successors["a"] = graph.successors("a");
|
||||
graph.transition = (selection: d3.Selection<any>) => {
|
||||
return d3.transition();
|
||||
};
|
||||
|
||||
const render = new dagreD3.render();
|
||||
const svg = d3.select("svg");
|
||||
|
||||
Vendored
+2
@@ -19,6 +19,8 @@ declare namespace Dagre {
|
||||
height: number;
|
||||
predecessors(id: string): string[];
|
||||
successors(id: string): string[];
|
||||
// see source of http://cpettitt.github.io/project/dagre-d3/latest/demo/interactive-demo.html
|
||||
transition?(selection: d3.Selection<any>): d3.Transition<any>;
|
||||
width: number;
|
||||
}
|
||||
|
||||
|
||||
+18
-16
@@ -17,21 +17,23 @@ declare namespace Express {
|
||||
declare module "express-serve-static-core" {
|
||||
import * as http from "http";
|
||||
|
||||
type RequestHandlerParams = RequestHandler | RequestHandler[];
|
||||
|
||||
interface IRoute {
|
||||
path: string;
|
||||
stack: any;
|
||||
all(...handler: RequestHandler[]): IRoute;
|
||||
get(...handler: RequestHandler[]): IRoute;
|
||||
post(...handler: RequestHandler[]): IRoute;
|
||||
put(...handler: RequestHandler[]): IRoute;
|
||||
delete(...handler: RequestHandler[]): IRoute;
|
||||
patch(...handler: RequestHandler[]): IRoute;
|
||||
options(...handler: RequestHandler[]): IRoute;
|
||||
head(...handler: RequestHandler[]): IRoute;
|
||||
all(...handler: RequestHandlerParams[]): IRoute;
|
||||
get(...handler: RequestHandlerParams[]): IRoute;
|
||||
post(...handler: RequestHandlerParams[]): IRoute;
|
||||
put(...handler: RequestHandlerParams[]): IRoute;
|
||||
delete(...handler: RequestHandlerParams[]): IRoute;
|
||||
patch(...handler: RequestHandlerParams[]): IRoute;
|
||||
options(...handler: RequestHandlerParams[]): IRoute;
|
||||
head(...handler: RequestHandlerParams[]): IRoute;
|
||||
}
|
||||
|
||||
interface IRouterMatcher<T> {
|
||||
(name: string | RegExp, ...handlers: RequestHandler[]): T;
|
||||
(name: string | RegExp, ...handlers: RequestHandlerParams[]): T;
|
||||
}
|
||||
|
||||
interface IRouter<T> extends RequestHandler {
|
||||
@@ -88,13 +90,13 @@ declare module "express-serve-static-core" {
|
||||
|
||||
route(path: string): IRoute;
|
||||
|
||||
use(...handler: RequestHandler[]): T;
|
||||
use(handler: ErrorRequestHandler | RequestHandler): T;
|
||||
use(path: string, ...handler: RequestHandler[]): T;
|
||||
use(path: string, handler: ErrorRequestHandler | RequestHandler): T;
|
||||
use(path: string[], ...handler: RequestHandler[]): T;
|
||||
use(...handler: RequestHandlerParams[]): T;
|
||||
use(handler: ErrorRequestHandler | RequestHandlerParams): T;
|
||||
use(path: string, ...handler: RequestHandlerParams[]): T;
|
||||
use(path: string, handler: ErrorRequestHandler | RequestHandlerParams): T;
|
||||
use(path: string[], ...handler: RequestHandlerParams[]): T;
|
||||
use(path: string[], handler: ErrorRequestHandler): T;
|
||||
use(path: RegExp, ...handler: RequestHandler[]): T;
|
||||
use(path: RegExp, ...handler: RequestHandlerParams[]): T;
|
||||
use(path: RegExp, handler: ErrorRequestHandler): T;
|
||||
use(path: string, router: Router): T;
|
||||
}
|
||||
@@ -860,7 +862,7 @@ declare module "express-serve-static-core" {
|
||||
set(setting: string, val: any): Application;
|
||||
get: {
|
||||
(name: string): any; // Getter
|
||||
(name: string | RegExp, ...handlers: RequestHandler[]): Application;
|
||||
(name: string | RegExp, ...handlers: RequestHandlerParams[]): Application;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+6
-2
@@ -3,7 +3,7 @@
|
||||
// Definitions by: kmxz <https://github.com/kmxz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'fbemitter' {
|
||||
declare namespace FBEmitter {
|
||||
|
||||
export class EventSubscription {
|
||||
|
||||
@@ -64,4 +64,8 @@ declare module 'fbemitter' {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'fbemitter' {
|
||||
export = FBEmitter;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/// <reference path="flux.d.ts" />
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
import flux = require('flux')
|
||||
import FluxUtils = require('flux/utils')
|
||||
@@ -88,7 +88,7 @@ export = customDispatcher
|
||||
|
||||
|
||||
// Sample Reduce Store
|
||||
class CounterStore extends FluxUtils.ReduceStore<number> {
|
||||
class CounterStore extends FluxUtils.ReduceStore<number, Action> {
|
||||
getInitialState(): number {
|
||||
return 0;
|
||||
}
|
||||
@@ -126,4 +126,4 @@ class CounterContainer extends Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
const container = Container.create(CounterContainer);
|
||||
const container = Container.create<CounterContainer>(CounterContainer);
|
||||
|
||||
Vendored
+35
-13
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../fbemitter/fbemitter.d.ts" />
|
||||
/// <reference path="../immutable/immutable.d.ts" />
|
||||
|
||||
declare namespace Flux {
|
||||
|
||||
@@ -71,6 +73,29 @@ declare module "flux" {
|
||||
declare namespace FluxUtils {
|
||||
|
||||
import React = __React;
|
||||
import fbEmitter = FBEmitter;
|
||||
import immutable = Immutable;
|
||||
|
||||
/**
|
||||
* Default options to create a Container with
|
||||
*
|
||||
* @interface RealOptions
|
||||
*/
|
||||
interface RealOptions {
|
||||
/**
|
||||
* Default value: true
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
pure?: boolean;
|
||||
/**
|
||||
* Default value: false
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
withProps?: boolean;
|
||||
}
|
||||
|
||||
export class Container {
|
||||
constructor();
|
||||
/**
|
||||
@@ -78,14 +103,13 @@ declare namespace FluxUtils {
|
||||
* that updates its state when relevant stores change.
|
||||
* The provided base class must have static methods getStores() and calculateState().
|
||||
*/
|
||||
static create(base: React.ComponentClass<any>, options?: any): React.ComponentClass<any>;
|
||||
static create<TComponent>(base: React.ComponentClass<TComponent>, options?: RealOptions): React.ComponentClass<TComponent>;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class extends ReduceStore and defines the state as an immutable map.
|
||||
*/
|
||||
// TODO: Change <any> to <Immutable.Map<K, V>>
|
||||
export class MapStore<K extends string | number, V> extends ReduceStore<any> {
|
||||
export class MapStore<K extends string | number, V, TPayload> extends ReduceStore<immutable.Map<K, V>, TPayload> {
|
||||
/**
|
||||
* Access the value at the given key.
|
||||
* Throws an error if the key does not exist in the cache.
|
||||
@@ -108,12 +132,10 @@ declare namespace FluxUtils {
|
||||
* it allows providing a previous result to update instead of generating a new map.
|
||||
* Providing a previous result allows the possibility of keeping the same reference if the keys did not change.
|
||||
*/
|
||||
// TODO: Update with Immutable interface.
|
||||
// getAll(keys: Immutable.IndexedIterable<K>, prev?: Immutable.Map<K, V>): Immutable.Map<K, V>;
|
||||
getAll(keys: any, prev?: any): any;
|
||||
getAll(keys: immutable.Iterable.Indexed<K>, prev?: immutable.Map<K, V>): immutable.Map<K, V>;
|
||||
}
|
||||
|
||||
export class ReduceStore<T> extends Store {
|
||||
export class ReduceStore<T, TPayload> extends Store<TPayload> {
|
||||
/**
|
||||
* Getter that exposes the entire state of this store.
|
||||
* If your state is not immutable you should override this and not expose state directly.
|
||||
@@ -131,7 +153,7 @@ declare namespace FluxUtils {
|
||||
* All subclasses must implement this method.
|
||||
* This method should be pure and have no side-effects.
|
||||
*/
|
||||
reduce(state: T, action: any): T;
|
||||
reduce(state: T, action: TPayload): T;
|
||||
|
||||
/**
|
||||
* Checks if two versions of state are the same.
|
||||
@@ -141,24 +163,24 @@ declare namespace FluxUtils {
|
||||
|
||||
}
|
||||
|
||||
export class Store {
|
||||
export class Store<TPayload> {
|
||||
|
||||
/**
|
||||
* Constructs and registers an instance of this store with the given dispatcher.
|
||||
*/
|
||||
constructor(dispatcher: Flux.Dispatcher<any>);
|
||||
constructor(dispatcher: Flux.Dispatcher<TPayload>);
|
||||
|
||||
/**
|
||||
* Adds a listener to the store, when the store changes the given callback will be called.
|
||||
* A token is returned that can be used to remove the listener.
|
||||
* Calling the remove() function on the returned token will remove the listener.
|
||||
*/
|
||||
addListener(callback: Function): { remove: Function };
|
||||
addListener(callback: Function): fbEmitter.EventSubscription;
|
||||
|
||||
/**
|
||||
* Returns the dispatcher this store is registered with.
|
||||
*/
|
||||
getDispatcher(): Flux.Dispatcher<any>;
|
||||
getDispatcher(): Flux.Dispatcher<TPayload>;
|
||||
|
||||
/**
|
||||
* Returns the dispatch token that the dispatcher recognizes this store by.
|
||||
@@ -185,7 +207,7 @@ declare namespace FluxUtils {
|
||||
* This is how the store receives actions from the dispatcher.
|
||||
* All state mutation logic must be done during this method.
|
||||
*/
|
||||
__onDispatch(payload: any): void;
|
||||
__onDispatch(payload: TPayload): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,11 @@ var point: GeoJSON.Point = {
|
||||
coordinates: [100.0, 0.0]
|
||||
};
|
||||
|
||||
|
||||
// This type is commonly used in the turf package
|
||||
var pointCoordinates: number[] = point.coordinates
|
||||
|
||||
|
||||
var lineString: GeoJSON.LineString = {
|
||||
type: "LineString",
|
||||
coordinates: [ [100.0, 0.0], [101.0, 1.0] ]
|
||||
@@ -126,4 +131,4 @@ var geometryCollection: GeoJSON.GeometryCollection = {
|
||||
coordinates: [ [101.0, 0.0], [102.0, 1.0] ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-4
@@ -18,10 +18,7 @@ declare namespace GeoJSON {
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#positions
|
||||
*/
|
||||
export interface Position
|
||||
{
|
||||
[index: number]: number;
|
||||
}
|
||||
export type Position = number[]
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geometry-objects
|
||||
|
||||
@@ -322,6 +322,11 @@ app.on('login', function(event, webContents, request, authInfo, callback) {
|
||||
callback('username', 'secret');
|
||||
});
|
||||
|
||||
var win = new BrowserWindow({show: false})
|
||||
win.once('ready-to-show', () => {
|
||||
win.show();
|
||||
});
|
||||
|
||||
app.relaunch({args: process.argv.slice(1).concat(['--relaunch'])});
|
||||
app.exit(0);
|
||||
|
||||
@@ -354,6 +359,8 @@ win.show();
|
||||
var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
|
||||
win.setSheetOffset(toolbarRect.height);
|
||||
|
||||
var installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron');
|
||||
|
||||
// content-tracing
|
||||
// https://github.com/atom/electron/blob/master/docs/api/content-tracing.md
|
||||
|
||||
@@ -728,6 +735,8 @@ var image = clipboard.readImage();
|
||||
var appIcon3 = new Tray(image);
|
||||
var appIcon4 = new Tray('/Users/somebody/images/icon.png');
|
||||
|
||||
let image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png');
|
||||
|
||||
// process
|
||||
// https://github.com/electron/electron/blob/master/docs/api/process.md
|
||||
|
||||
@@ -828,15 +837,23 @@ session.defaultSession.on('will-download', (event, item, webContents) => {
|
||||
console.log(item.getFilename());
|
||||
console.log(item.getTotalBytes());
|
||||
|
||||
item.on('updated', function() {
|
||||
console.log('Received bytes: ' + item.getReceivedBytes());
|
||||
item.on('updated', (event, state) => {
|
||||
if (state === 'interrupted') {
|
||||
console.log('Download is interrupted but can be resumed');
|
||||
} else if (state === 'progressing') {
|
||||
if (item.isPaused()) {
|
||||
console.log('Download is paused');
|
||||
} else {
|
||||
console.log(`Received bytes: ${item.getReceivedBytes()}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
item.on('done', function(e, state) {
|
||||
if (state == "completed") {
|
||||
console.log("Download successfully");
|
||||
} else {
|
||||
console.log("Download is cancelled or interrupted that can't be resumed");
|
||||
console.log(`Download failed: ${state}`)
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -884,3 +901,15 @@ session.defaultSession.webRequest.onBeforeSendHeaders(filter, function(details,
|
||||
details.requestHeaders['User-Agent'] = "MyAgent";
|
||||
callback({cancel: false, requestHeaders: details.requestHeaders});
|
||||
});
|
||||
|
||||
app.on('ready', function () {
|
||||
const protocol = session.defaultSession.protocol
|
||||
protocol.registerFileProtocol('atom', function (request, callback) {
|
||||
var url = request.url.substr(7);
|
||||
callback({path: path.normalize(__dirname + '/' + url)});
|
||||
}, function (error) {
|
||||
if (error) {
|
||||
console.error('Failed to register protocol');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Vendored
+65
-8
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Electron v1.2.2
|
||||
// Type definitions for Electron v1.2.3
|
||||
// Project: http://electron.atom.io/
|
||||
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -115,6 +115,10 @@ declare namespace Electron {
|
||||
* Emitted when a new browserWindow is created.
|
||||
*/
|
||||
on(event: 'browser-window-created', listener: (event: Event, browserWindow: BrowserWindow) => void): this;
|
||||
/**
|
||||
* Emitted when a new webContents is created.
|
||||
*/
|
||||
on(event: 'web-contents-created', listener: (event: Event, webContents: WebContents) => void): this;
|
||||
/**
|
||||
* Emitted when failed to verify the certificate for url, to trust the certificate
|
||||
* you should prevent the default behavior with event.preventDefault() and call callback(true).
|
||||
@@ -344,7 +348,7 @@ declare namespace Electron {
|
||||
dock: Dock;
|
||||
}
|
||||
|
||||
type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos';
|
||||
type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'|'pepperFlashSystemPlugin';
|
||||
|
||||
interface ImportCertificateOptions {
|
||||
/**
|
||||
@@ -498,9 +502,8 @@ declare namespace Electron {
|
||||
on(event: string, listener: Function): this;
|
||||
/**
|
||||
* Set the url and initialize the auto updater.
|
||||
* The url cannot be changed once it is set.
|
||||
*/
|
||||
setFeedURL(url: string): void;
|
||||
setFeedURL(url: string, requestHeaders?: Headers): void;
|
||||
/**
|
||||
* Ask the server whether there is an update, you have to call setFeedURL
|
||||
* before using this API
|
||||
@@ -559,6 +562,10 @@ declare namespace Electron {
|
||||
* Emitted when the window is hidden.
|
||||
*/
|
||||
on(event: 'hide', listener: Function): this;
|
||||
/**
|
||||
* Emitted when the web page has been rendered and window can be displayed without visual flash.
|
||||
*/
|
||||
on(event: 'ready-to-show', listener: Function): this;
|
||||
/**
|
||||
* Emitted when window is maximized.
|
||||
*/
|
||||
@@ -650,6 +657,10 @@ declare namespace Electron {
|
||||
* @param name The name of the devtools extension to remove.
|
||||
*/
|
||||
static removeDevToolsExtension(name: string): void;
|
||||
/**
|
||||
* @returns devtools extensions.
|
||||
*/
|
||||
static getDevToolsExtensions(): DevToolsExtensions;
|
||||
/**
|
||||
* The WebContents object this window owns, all web page related events and
|
||||
* operations would be done via it.
|
||||
@@ -996,7 +1007,7 @@ declare namespace Electron {
|
||||
*/
|
||||
setThumbarButtons(buttons: ThumbarButton[]): boolean;
|
||||
/**
|
||||
* Shows pop-up dictionary that searches the selected word on the page.
|
||||
* Same as webContents.showDefinitionForSelection().
|
||||
* Note: This API is available only on OS X.
|
||||
*/
|
||||
showDefinitionForSelection(): void;
|
||||
@@ -1042,6 +1053,11 @@ declare namespace Electron {
|
||||
* but if this window has focus, it will still receive keyboard events.
|
||||
*/
|
||||
setIgnoreMouseEvents(ignore: boolean): void;
|
||||
/**
|
||||
* Changes whether the window can be focused.
|
||||
* Note: This API is available only on Windows.
|
||||
*/
|
||||
setFocusable(focusable: boolean): void;
|
||||
}
|
||||
|
||||
type SwipeDirection = 'up' | 'right' | 'down' | 'left';
|
||||
@@ -1055,6 +1071,13 @@ declare namespace Electron {
|
||||
flags?: ThumbarButtonFlags[];
|
||||
}
|
||||
|
||||
interface DevToolsExtensions {
|
||||
[name: string]: {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface WebPreferences {
|
||||
/**
|
||||
* Whether node integration is enabled.
|
||||
@@ -1290,6 +1313,14 @@ declare namespace Electron {
|
||||
* Default: true.
|
||||
*/
|
||||
closable?: boolean;
|
||||
/**
|
||||
* Whether the window can be focused.
|
||||
* On Windows setting focusable: false also implies setting skipTaskbar: true.
|
||||
* On Linux setting focusable: false makes the window stop interacting with wm,
|
||||
* so the window will always stay on top in all workspaces.
|
||||
* Default: true.
|
||||
*/
|
||||
focusable?: boolean;
|
||||
/**
|
||||
* Whether the window should always stay on top of other windows.
|
||||
* Default: false.
|
||||
@@ -1832,9 +1863,9 @@ declare namespace Electron {
|
||||
*/
|
||||
interface DownloadItem extends NodeJS.EventEmitter {
|
||||
/**
|
||||
* Emits when the downloadItem gets updated.
|
||||
* Emitted when the download has been updated and is not done.
|
||||
*/
|
||||
on(event: 'updated', listener: Function): this;
|
||||
on(event: 'updated', listener: (event: Event, state: 'progressing' | 'interrupted') => void): this;
|
||||
/**
|
||||
* Emits when the download is in a terminal state. This includes a completed download,
|
||||
* a cancelled download (via downloadItem.cancel()), and interrupted download that can’t be resumed.
|
||||
@@ -1852,10 +1883,18 @@ declare namespace Electron {
|
||||
* Pauses the download.
|
||||
*/
|
||||
pause(): void;
|
||||
/**
|
||||
* @returns Whether the download is paused.
|
||||
*/
|
||||
isPaused(): boolean;
|
||||
/**
|
||||
* Resumes the download that has been paused.
|
||||
*/
|
||||
resume(): void;
|
||||
/**
|
||||
* @returns Whether the download can resume.
|
||||
*/
|
||||
canResume(): boolean;
|
||||
/**
|
||||
* Cancels the download operation.
|
||||
*/
|
||||
@@ -1891,6 +1930,10 @@ declare namespace Electron {
|
||||
* @returns The Content-Disposition field from the response header.
|
||||
*/
|
||||
getContentDisposition(): string;
|
||||
/**
|
||||
* @returns The current state.
|
||||
*/
|
||||
getState(): 'progressing' | 'completed' | 'cancelled' | 'interrupted';
|
||||
}
|
||||
|
||||
// https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md
|
||||
@@ -2042,7 +2085,7 @@ declare namespace Electron {
|
||||
|
||||
type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio';
|
||||
type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close';
|
||||
type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'front' | 'window' | 'help' | 'services';
|
||||
type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'front' | 'zoom' | 'window' | 'help' | 'services';
|
||||
|
||||
interface MenuItemOptions {
|
||||
/**
|
||||
@@ -2635,6 +2678,10 @@ declare namespace Electron {
|
||||
* The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime.
|
||||
*/
|
||||
webRequest: WebRequest;
|
||||
/**
|
||||
* @returns An instance of protocol module for this session.
|
||||
*/
|
||||
protocol: Protocol;
|
||||
}
|
||||
|
||||
type Permission = 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal';
|
||||
@@ -3643,6 +3690,11 @@ declare namespace Electron {
|
||||
* @returns If the process of saving page has been initiated successfully.
|
||||
*/
|
||||
savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML', callback?: (eror: Error) => void): boolean;
|
||||
/**
|
||||
* Shows pop-up dictionary that searches the selected word on the page.
|
||||
* Note: This API is available only on OS X.
|
||||
*/
|
||||
showDefinitionForSelection(): void;
|
||||
/**
|
||||
* @returns The unique ID of this WebContents.
|
||||
*/
|
||||
@@ -4428,6 +4480,11 @@ declare namespace Electron {
|
||||
* See webContents.sendInputEvent for detailed description of event object.
|
||||
*/
|
||||
sendInputEvent(event: SendInputEvent): void
|
||||
/**
|
||||
* Shows pop-up dictionary that searches the selected word on the page.
|
||||
* Note: This API is available only on OS X.
|
||||
*/
|
||||
showDefinitionForSelection(): void;
|
||||
/**
|
||||
* @returns The WebContents associated with this webview.
|
||||
*/
|
||||
|
||||
Vendored
+319
-17
@@ -1,28 +1,330 @@
|
||||
// Type definitions for Globalize
|
||||
// Type definitions for Globalize
|
||||
// Project: https://github.com/jquery/globalize
|
||||
// Definitions by: Aram Taieb <https://github.com/afromogli/>
|
||||
// Definitions: https://github.com/afromogli/DefinitelyTyped
|
||||
// Definitions by: Grégoire Castre <https://github.com/gcastre/>, Aram Taieb <https://github.com/afromogli/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Note: You'll need the cldr.js definition file to use the globalize (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cldr.js)
|
||||
|
||||
interface NumberFormatterOptions {
|
||||
minimumIntegerDigits?: number;
|
||||
minimumFractionDigits?: number;
|
||||
maximumFractionDigits?: number;
|
||||
minimumSignificantDigits?: number;
|
||||
maximumSignificantDigits?: number;
|
||||
round?: string;
|
||||
useGrouping?: boolean;
|
||||
/// <reference path="../cldr.js/cldr.js.d.ts" />
|
||||
|
||||
interface DateFormatterOptions {
|
||||
/**
|
||||
* String value indicating a skeleton (see description above), eg. { skeleton: "GyMMMd" }.
|
||||
* Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime.
|
||||
* Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order.
|
||||
*/
|
||||
skeleton?: string;
|
||||
/**
|
||||
* One of the following String values: full, long, medium, or short, eg. { date: "full" }.
|
||||
*/
|
||||
date?: "full" | "long" | "medium" | "short";
|
||||
/**
|
||||
* One of the following String values: full, long, medium, or short, eg. { time: "full" }.
|
||||
*/
|
||||
time?: "full" | "long" | "medium" | "short";
|
||||
/**
|
||||
* One of the following String values: full, long, medium, or short, eg. { datetime: "full" }
|
||||
*/
|
||||
datetime?: "full" | "long" | "medium" | "short";
|
||||
/**
|
||||
* String value indicating a machine raw pattern (anything in the "Sym." column) eg. { raw: "dd/mm" }.
|
||||
* Note this is NOT recommended for i18n in general. Use skeleton instead.
|
||||
*/
|
||||
raw?: string;
|
||||
}
|
||||
|
||||
interface Cldr {
|
||||
/* TODO: add typings */
|
||||
interface CommonNumberFormatterOptions {
|
||||
/**
|
||||
* Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary.
|
||||
*/
|
||||
minimumIntegerDigits?: number;
|
||||
/**
|
||||
* Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.
|
||||
* Numbers will be rounded or padded with trailing zeroes if necessary.
|
||||
* Either one or both of these properties must be present.
|
||||
* If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.
|
||||
*/
|
||||
minimumFractionDigits?: number;
|
||||
/**
|
||||
* Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.
|
||||
* Numbers will be rounded or padded with trailing zeroes if necessary.
|
||||
* Either one or both of these properties must be present.
|
||||
* If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.
|
||||
*/
|
||||
maximumFractionDigits?: number;
|
||||
/**
|
||||
* Positive integer Number values indicating the minimum and maximum fraction digits to be shown.
|
||||
* Either none or both of these properties are present
|
||||
* If they are, they override minimum and maximum integer and fraction digits.
|
||||
* The formatter uses however many integer and fraction digits are required to display the specified number of significant digits.
|
||||
*/
|
||||
minimumSignificantDigits?: number;
|
||||
/**
|
||||
* Positive integer Number values indicating the minimum and maximum fraction digits to be shown.
|
||||
* Either none or both of these properties are present.
|
||||
* If they are, they override minimum and maximum integer and fraction digits.
|
||||
* The formatter uses however many integer and fraction digits are required to display the specified number of significant digits.
|
||||
*/
|
||||
maximumSignificantDigits?: number;
|
||||
/**
|
||||
* String with rounding method ceil, floor, round (default), or truncate.
|
||||
*/
|
||||
round?: "ceil" | "floor" | "round" | "truncate";
|
||||
/**
|
||||
* Boolean (default is true) value indicating whether a grouping separator should be used.
|
||||
*/
|
||||
useGrouping?: boolean;
|
||||
}
|
||||
|
||||
interface NumberFormatterOptions extends CommonNumberFormatterOptions {
|
||||
/**
|
||||
* decimal (default), or percent
|
||||
*/
|
||||
style?: "decimal" | "percent";
|
||||
}
|
||||
|
||||
interface CurrencyFormatterOptions extends CommonNumberFormatterOptions {
|
||||
/**
|
||||
* symbol (default), accounting, code or name.
|
||||
*/
|
||||
style?: "symbol" | "accounting" | "code" | "name";
|
||||
}
|
||||
|
||||
interface NumberParserOptions {
|
||||
/**
|
||||
* decimal (default), or percent.
|
||||
*/
|
||||
style?: "decimal" | "percent";
|
||||
}
|
||||
|
||||
interface PluralGeneratorOptions {
|
||||
/**
|
||||
* cardinal (default), or ordinal.
|
||||
*/
|
||||
type?: "cardinal" | "ordinal";
|
||||
}
|
||||
|
||||
interface RelativeTimeFormatterOptions {
|
||||
/**
|
||||
* eg. "short" or "narrow". Or falsy for default long form
|
||||
*/
|
||||
form?: "short" | "narrow";
|
||||
}
|
||||
|
||||
interface UnitFormatterOptions {
|
||||
/**
|
||||
* form: [String] eg. "long", "short" or "narrow".
|
||||
*/
|
||||
form?: "long" | "short" | "narrow";
|
||||
|
||||
/**
|
||||
* numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options.
|
||||
*/
|
||||
numberFormatter?: NumberFormatterOptions;
|
||||
}
|
||||
|
||||
interface GlobalizeStatic {
|
||||
load(jsonData: any): void;
|
||||
locale(locale: string): Cldr;
|
||||
|
||||
numberFormatter(options?: NumberFormatterOptions): (value: number) => string;
|
||||
formatNumber(value:number, options?: NumberFormatterOptions): string;
|
||||
cldr: cldr.CldrStatic;
|
||||
|
||||
/**
|
||||
* Globalize.load( json, ... )
|
||||
* @param {Object} [JSON]
|
||||
* Load resolved or unresolved cldr data.
|
||||
* Somewhat equivalent to previous Globalize.addCultureInfo(...).
|
||||
*/
|
||||
load(json: Object): void;
|
||||
|
||||
/**
|
||||
* Globalize.locale()
|
||||
* Return the default Cldr instance.
|
||||
*/
|
||||
locale(): cldr.CldrStatic;
|
||||
|
||||
/**
|
||||
* Globalize.locale( [locale] )
|
||||
* @param {string} locale
|
||||
* Set default Cldr instance
|
||||
* Return the default Cldr instance.
|
||||
*/
|
||||
|
||||
locale(locale: string): cldr.CldrStatic;
|
||||
/**
|
||||
* Globalize.locale( cldr )
|
||||
* @param {Cldr} cldr [Cldr instance]
|
||||
* Set default Cldr instance
|
||||
* Return the default Cldr instance.
|
||||
*/
|
||||
locale(cldr: cldr.CldrStatic): cldr.CldrStatic;
|
||||
|
||||
/**
|
||||
* .dateFormatter( options )
|
||||
* @param {DateFormatterOptions} options see date/expand_pattern for more info.
|
||||
* @returns {Function} Return a function that formats a date according to the given `options` and the default/instance locale.
|
||||
*/
|
||||
dateFormatter(options?: DateFormatterOptions): (value: Date) => string;
|
||||
|
||||
//Return a function that parses a string representing a date into a JavaScript Date object according to the given options. The default parsing assumes numeric year, month, and day (i.e., { skeleton: "yMd" }).
|
||||
dateParser(options?: DateFormatterOptions): (value: string) => Date;
|
||||
|
||||
//Alias for .dateFormatter( [options] )( value ).
|
||||
formatDate(value: Date, options?: DateFormatterOptions): string;
|
||||
/**
|
||||
* Alias for .dateParser( [options] )( value ).
|
||||
* @param {string} value The object whose module id you wish to determine.
|
||||
* @param {DateFormatterOptions} options The object whose module id you wish to determine.
|
||||
* @returns {Date} Return the value as a Date.
|
||||
*/
|
||||
parseDate(value: string, options?: DateFormatterOptions): Date;
|
||||
|
||||
/**
|
||||
* Load messages data.
|
||||
* @param {Object} json JSON object of messages data. Keys can use any character, except /, { and }. Values (i.e., the message content itself) can contain any character.
|
||||
* @returns {void}
|
||||
*/
|
||||
loadMessages(json: Object): void;
|
||||
/**
|
||||
* Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections.
|
||||
* @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ].
|
||||
* @returns {Function} Return A function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections.
|
||||
*/
|
||||
messageFormatter(path: string | string[]): (variables?: string | string[] | Object) => string;
|
||||
|
||||
/**
|
||||
* Formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string
|
||||
* @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ].
|
||||
* @param variables Variables can be Objects, where each property can be referenced by name inside a message; or Arrays, where each entry of the Array can be used inside a message, using numeric indices. When passing one or more arguments of other types, they're converted to an Array and used as such.
|
||||
* @returns {string} Return a user-readable string.
|
||||
*/
|
||||
formatMessage(path: string | string[], variables?: string | string[] | Object): string
|
||||
|
||||
/**
|
||||
* Return a function that formats a number according to the given options or locale's defaults.
|
||||
* @param {NumberFormatterOptions} options A JSON object including none or any of the following options.
|
||||
* style Optional String decimal (default), or percent.
|
||||
* minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary.
|
||||
* minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.
|
||||
* minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits.
|
||||
* round Optional String with rounding method ceil, floor, round (default), or truncate.
|
||||
* useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used.
|
||||
* @returns {Function} Return a function that formats a number according to the given options.
|
||||
*/
|
||||
numberFormatter(options?: NumberFormatterOptions): (value: number) => string;
|
||||
|
||||
/**
|
||||
* Return a function that parses a string representing a number according to the given options or locale's defaults.
|
||||
* @param {NumberParserOptions} options A JSON object including none or any of the following options.
|
||||
* style Optional String decimal (default), or percent.
|
||||
* @returns {Function} Return a function that parses a String representing a number according to the given options. If value is invalid, NaN is returned.
|
||||
*/
|
||||
numberParser(options?: NumberParserOptions): (value: string) => number
|
||||
|
||||
/**
|
||||
* Return a number formatted according to the given options or locale's defaults.
|
||||
* @param {number} value The number to format
|
||||
* @param {NumberFormatterOptions} options A JSON object including none or any of the following options.
|
||||
* style Optional String decimal (default), or percent.
|
||||
* minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary.
|
||||
* minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.
|
||||
* minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits.
|
||||
* round Optional String with rounding method ceil, floor, round (default), or truncate.
|
||||
* useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used.
|
||||
* @returns {string} Return the number formatted
|
||||
*/
|
||||
formatNumber(value: number, options?: NumberFormatterOptions): string;
|
||||
|
||||
/**
|
||||
* A function that parses a string representing a number according to the given options or locale's defaults.
|
||||
* @param {string} value The number as string to parse
|
||||
* @param {NumberParserOptions} options A JSON object including none or any of the following options.
|
||||
* style Optional String decimal (default), or percent.
|
||||
* @returns {number} Return a number according to the given options. If value is invalid, NaN is returned.
|
||||
*/
|
||||
parseNumber(value: string, options?: NumberParserOptions): number;
|
||||
|
||||
/**
|
||||
* Return a function that formats a currency according to the given options or locale's defaults.
|
||||
* The returned function is invoked with one argument: the Number value to be formatted.
|
||||
* @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD.
|
||||
* @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options.
|
||||
* @returns {Function} Return a function that formats a currency
|
||||
*/
|
||||
currencyFormatter(currency: string, options?: CurrencyFormatterOptions): (value: number) => string;
|
||||
|
||||
/**
|
||||
* Return a currency formatted according to the given options or locale's defaults.
|
||||
* @param {number} value The value to format.
|
||||
* @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD.
|
||||
* @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options.
|
||||
* @returns {string} Return a string formatted in the currency according to the value and the options
|
||||
*/
|
||||
formatCurrency(value: number, currency: string, options?: CurrencyFormatterOptions): string;
|
||||
|
||||
/**
|
||||
* Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other.
|
||||
* The returned function is invoked with one argument: the Number value for which to return the plural group.
|
||||
* @param {PluralGeneratorOptions} options A JSON object including none or any of the following options.
|
||||
* type Optional String cardinal (default), or ordinal.
|
||||
* @returns {Function} Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other.
|
||||
*/
|
||||
pluralGenerator(options?: PluralGeneratorOptions): (value: number) => string;
|
||||
|
||||
/**
|
||||
* Returns the value's corresponding plural group: zero, one, two, few, many, or other.
|
||||
* @param {number} value A Number for which to return the plural group.
|
||||
* @param {PluralGeneratorOptions} options A JSON object including none or any of the following options.
|
||||
* type Optional String cardinal (default), or ordinal.
|
||||
* @returns {string} Returns the value's corresponding plural group: zero, one, two, few, many, or other.
|
||||
*/
|
||||
plural(value: number, options?: PluralGeneratorOptions): string;
|
||||
|
||||
/**
|
||||
* Returns a function that formats a relative time according to the given unit, options, and the default/instance locale.
|
||||
* The returned function is invoked with one argument: the number value to be formatted.
|
||||
* @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc.
|
||||
* @param options form: [String] eg. "short" or "narrow". Or falsy for default long form.
|
||||
* @returns {Function} Returns a function that formats a relative time according to the given unit.
|
||||
*/
|
||||
relativeTimeFormatter(unit: string, options?: RelativeTimeFormatterOptions): (value: number) => string;
|
||||
|
||||
/**
|
||||
* Return a relative time according to the given unit
|
||||
* @param {number} value The number to be formatted.
|
||||
* @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc.
|
||||
* @param options form: [String] eg. "short" or "narrow". Or falsy for default long form.
|
||||
* @returns {string} Return a relative time according to the given unit.
|
||||
*/
|
||||
formatRelativeTime(value: number, unit: string, options?: RelativeTimeFormatterOptions): string;
|
||||
|
||||
/**
|
||||
* Returns a function that formats a unit according to the given unit, options, and the default/instance locale.
|
||||
* The returned function is invoked with one argument: the number value to be formatted.
|
||||
* @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour"
|
||||
* @param options form: [String] eg. "long", "short" or "narrow".
|
||||
* @returns {Function} Returns a function that formats a unit according to the given unit, options, and the default/instance locale.
|
||||
*/
|
||||
unitFormatter(unit: string, options?: UnitFormatterOptions): (value: number) => string;
|
||||
|
||||
/**
|
||||
* Alias for .unitFormatter( unit, options )( value ).
|
||||
* @param {number} value The number to be formatted.
|
||||
* @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour"
|
||||
* @param {UnitFormatterOptions} options form: [String] eg. "long", "short" or "narrow".
|
||||
* @returns {string} Returns the unit formatted.
|
||||
*/
|
||||
formatUnit(value: number, unit: string, options?: UnitFormatterOptions): string
|
||||
|
||||
/**
|
||||
* Create a Globalize instance.
|
||||
* @param {string} Locale string of the instance.
|
||||
* @returns {Globalize} A Globalize instance
|
||||
*/
|
||||
new (locale: string): GlobalizeStatic;
|
||||
/**
|
||||
* Create a Globalize instance.
|
||||
* @param cldr Cldr instance of the instance.
|
||||
* @returns {Globalize} A Globalize instance
|
||||
*/
|
||||
new (cldr: cldr.CldrStatic): GlobalizeStatic;
|
||||
}
|
||||
|
||||
declare var Globalize: GlobalizeStatic;
|
||||
|
||||
Vendored
+7
@@ -1585,6 +1585,10 @@ declare namespace google.maps {
|
||||
setZoom(zoom: number): void;
|
||||
}
|
||||
|
||||
export interface FullscreenControlOptions {
|
||||
position?: ControlPosition;
|
||||
}
|
||||
|
||||
export interface StreetViewPanoramaOptions {
|
||||
addressControl?: boolean;
|
||||
addressControlOptions?: StreetViewAddressControlOptions;
|
||||
@@ -1592,8 +1596,11 @@ declare namespace google.maps {
|
||||
disableDefaultUi?: boolean;
|
||||
disableDoubleClickZoom?: boolean;
|
||||
enableCloseButton?: boolean;
|
||||
fullscreenControl?: boolean;
|
||||
fullscreenControlOptions?: FullscreenControlOptions;
|
||||
imageDateControl?: boolean;
|
||||
linksControl?: boolean;
|
||||
mode?: "html4" | "html5" |"webgl";
|
||||
panControl?: boolean;
|
||||
panControlOptions?: PanControlOptions;
|
||||
pano?: string;
|
||||
|
||||
Vendored
+2
-1
@@ -77,8 +77,9 @@ interface HeatmapConfiguration {
|
||||
|
||||
/*
|
||||
* The property name of the value/weight in a datapoint
|
||||
* Default value: 'value'
|
||||
*/
|
||||
valueField: string;
|
||||
valueField?: string;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+2
-2
@@ -4954,7 +4954,7 @@ interface HighchartsDataPoint {
|
||||
* The inner radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string.
|
||||
* @since 4.1.6
|
||||
*/
|
||||
innerRadius?: number;
|
||||
innerRadius?: number|string;
|
||||
/**
|
||||
* When this property is true, the points acts as a summary column for the values added or substracted since the
|
||||
* last intermediate sum, or since the start of the series. The y value is ignored.
|
||||
@@ -5005,7 +5005,7 @@ interface HighchartsDataPoint {
|
||||
* The outer radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string.
|
||||
* @since 4.1.6
|
||||
*/
|
||||
radius?: number;
|
||||
radius?: number|string;
|
||||
/**
|
||||
* Whether the data point is selected initially.
|
||||
* @default false
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="intl-tel-input.d.ts" />
|
||||
|
||||
$('#phone').intlTelInput();
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
|
||||
return 'e.g. ' + selectedCountryPlaceholder;
|
||||
}
|
||||
});
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
geoIpLookup: function(callback) {
|
||||
$.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) {
|
||||
let countryCode = (resp && resp.country) ? <string> resp.country : '';
|
||||
callback(countryCode);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#phone').intlTelInput('destroy');
|
||||
|
||||
let extension = $('#phone').intlTelInput('getExtension');
|
||||
|
||||
let intlNumber = $('#phone').intlTelInput('getNumber');
|
||||
let ntlNumber = $('#phone').intlTelInput('getNumber', intlTelInputUtils.numberFormat.NATIONAL);
|
||||
|
||||
let numberType = $('#phone').intlTelInput('getNumberType');
|
||||
if (numberType === intlTelInputUtils.numberType.MOBILE) {}
|
||||
|
||||
let countryData = $('#phone').intlTelInput('getSelectedCountryData');
|
||||
|
||||
let error = $('#phone').intlTelInput('getValidationError');
|
||||
if (error === intlTelInputUtils.validationError.TOO_SHORT) {}
|
||||
|
||||
let isValid = $('#phone').intlTelInput('isValidNumber');
|
||||
|
||||
$('#phone').intlTelInput('setCountry', 'gb');
|
||||
|
||||
$('#phone').intlTelInput('setNumber', '+447733123456');
|
||||
|
||||
let countryData3 = $.intlTelInput.getCountryData();
|
||||
|
||||
$.intlTelInput.loadUtils('build/js/utils.js');
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
});
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
initialCountry: 'auto',
|
||||
geoIpLookup: function(callback) {
|
||||
$.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) {
|
||||
let countryCode = (resp && resp.country) ? resp.country : '';
|
||||
callback(countryCode);
|
||||
});
|
||||
},
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
});
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
nationalMode: true,
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
});
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
onlyCountries: ['al'],
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
});
|
||||
Vendored
+252
@@ -0,0 +1,252 @@
|
||||
// Type definitions for intl-tel-input
|
||||
// Project: https://github.com/jackocnr/intl-tel-input
|
||||
// Definitions by: Fidan Hakaj <https://github.com/fdnhkj/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace IntlTelInput {
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Whether or not to allow the dropdown. If disabled, there is no dropdown
|
||||
* arrow, and the selected flag is not clickable. Also we display the
|
||||
* selected flag on the right instead because it is just a marker of state.
|
||||
*/
|
||||
allowDropdown?: boolean;
|
||||
/**
|
||||
* If there is just a dial code in the input: remove it on blur or submit,
|
||||
* and re-add it on focus. This is to prevent just a dial code getting
|
||||
* submitted with the form. Requires nationalMode to be set to false.
|
||||
*/
|
||||
autoHideDialCode?: boolean;
|
||||
/**
|
||||
* Set the input's placeholder to an example number for the selected country.
|
||||
* You can specify the number type using the numberType option.
|
||||
* If there is already a placeholder attribute set on the input then that
|
||||
* will take precedence. Requires the utilsScript option.
|
||||
*/
|
||||
autoPlaceholder?: boolean;
|
||||
/**
|
||||
* Change the placeholder generated by autoPlaceholder. Must return a string.
|
||||
*/
|
||||
customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: CountryData) => string;
|
||||
/**
|
||||
* Specify the container for the country dropdown (use a jQuery selector
|
||||
* e.g. "body"). This is useful when the input is within a scrolling element,
|
||||
* or an element with overflow: hidden. Wherever you put the dropdown it
|
||||
* will automatically close on the window scroll event to prevent positioning
|
||||
* issues. If you want it to close when a different element is scrolled
|
||||
* (such as the input's parent), simply listen for the that scroll event,
|
||||
* and trigger $(window).scroll() e.g.
|
||||
*/
|
||||
dropdownContainer?: string;
|
||||
/**
|
||||
* Don't display the countries you specify.
|
||||
*/
|
||||
excludeCountries?: Array<string>;
|
||||
/**
|
||||
* Format the input value during initialisation.
|
||||
*/
|
||||
formatOnInit?: boolean;
|
||||
/**
|
||||
* When setting initialCountry to "auto", you must use this option to
|
||||
* specify a custom function that looks up the user's location. Also note
|
||||
* that when instantiating the plugin, we now return a deferred object, so
|
||||
* you can use .done(callback) to know when initialisation requests like
|
||||
* this have completed.
|
||||
* Note that the callback must still be called in the event of an error.
|
||||
*/
|
||||
geoIpLookup?: (callback: (countryCode: string) => void) => void;
|
||||
/**
|
||||
* Set the initial country selection by specifying it's country code.
|
||||
* You can also set it to "auto", which will lookup the user's country based
|
||||
* on their IP address (requires the geoIpLookup option).
|
||||
* Note that the "auto" option will not update the country selection if the
|
||||
* input already contains a number. If you leave initialCountry blank,
|
||||
* it will default to the first country in the list.
|
||||
*/
|
||||
initialCountry?: string;
|
||||
/**
|
||||
* Allow users to enter national numbers (and not have to think about
|
||||
* international dial codes). Formatting, validation and placeholders still
|
||||
* work. Then you can use getNumber to extract a full international number.
|
||||
* This option now defaults to true, and it is recommended that you leave it
|
||||
* that way as it provides a better experience for the user.
|
||||
*/
|
||||
nationalMode?: boolean;
|
||||
/**
|
||||
* Specify one of the keys from the global enum intlTelInputUtils.numberType
|
||||
* e.g. "FIXED_LINE" to tell the plugin you're expecting that type of number.
|
||||
* Currently this is only used to set the placeholder to the right type of number.
|
||||
*/
|
||||
numberType?: string;
|
||||
/**
|
||||
* Display only the countries you specify.
|
||||
*/
|
||||
onlyCountries?: Array<string>;
|
||||
/**
|
||||
* Specify the countries to appear at the top of the list.
|
||||
*/
|
||||
preferredCountries?: Array<string>;
|
||||
/**
|
||||
* Display the country dial code next to the selected flag so it's not part
|
||||
* of the typed number. Note that this will disable nationalMode because
|
||||
* technically we are dealing with international numbers, but with the
|
||||
* dial code separated.
|
||||
*/
|
||||
separateDialCode?: boolean;
|
||||
/**
|
||||
* Enable formatting/validation etc. by specifying the path to the included
|
||||
* utils.js script, which is fetched only when the page has finished loading
|
||||
* (on window.load) to prevent blocking. When instantiating the plugin,
|
||||
* we return a deferred object, so you can use .done(callback) to know when
|
||||
* initialisation requests like this have finished. Note that if you're
|
||||
* lazy loading the plugin script itself (intlTelInput.js) this will not
|
||||
* work and you will need to use the loadUtils method instead.
|
||||
*/
|
||||
utilsScript?: string;
|
||||
}
|
||||
|
||||
interface CountryData {
|
||||
name: string;
|
||||
iso2: string;
|
||||
dialCode: string;
|
||||
}
|
||||
|
||||
interface Static {
|
||||
/**
|
||||
* Get all of the plugin's country data.
|
||||
* Note that any modifications must be done before initialising the plugin.
|
||||
*/
|
||||
getCountryData: () => Array<CountryData>;
|
||||
/**
|
||||
* Note: this is only needed if you're lazy loading the plugin script itself (intlTelInput.js).
|
||||
* If not then just use the utilsScript option. Load the utils.js script
|
||||
* (included in the lib directory) to enable formatting/validation etc.
|
||||
* @param path path to the utils.js script.
|
||||
*/
|
||||
loadUtils: (path: string) => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace intlTelInputUtils {
|
||||
|
||||
const enum numberFormat {
|
||||
E164 = 0,
|
||||
INTERNATIONAL = 1,
|
||||
NATIONAL = 2,
|
||||
RFC3966 = 3
|
||||
}
|
||||
|
||||
const enum numberType {
|
||||
FIXED_LINE = 0,
|
||||
MOBILE = 1,
|
||||
FIXED_LINE_OR_MOBILE = 2,
|
||||
TOLL_FREE = 3,
|
||||
PREMIUM_RATE = 4,
|
||||
SHARED_COST = 5,
|
||||
VOIP = 6,
|
||||
PERSONAL_NUMBER = 7,
|
||||
PAGER = 8,
|
||||
UAN = 9,
|
||||
VOICEMAIL = 10,
|
||||
UNKNOWN = -1
|
||||
}
|
||||
|
||||
const enum validationError {
|
||||
IS_POSSIBLE = 0,
|
||||
INVALID_COUNTRY_CODE = 1,
|
||||
TOO_SHORT = 2,
|
||||
TOO_LONG = 3,
|
||||
NOT_A_NUMBER = 4
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
intlTelInput: IntlTelInput.Static;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Remove the plugin from the input, and unbind any event listeners.
|
||||
*/
|
||||
intlTelInput(method: 'destroy'): void;
|
||||
/**
|
||||
* Get the extension from the current number.
|
||||
* Requires the utilsScript option.
|
||||
* e.g. if the input value was "(702) 555-5555 ext. 1234", this would
|
||||
* return "1234".
|
||||
*/
|
||||
intlTelInput(method: 'getExtension'): string;
|
||||
/**
|
||||
* Get the current number in the given format (defaults to E.164 standard).
|
||||
* The different formats are available in the enum
|
||||
* intlTelInputUtils.numberFormat - taken from here.
|
||||
* Requires the utilsScript option.
|
||||
* Note that even if nationalMode is enabled, this can still return a full
|
||||
* international number.
|
||||
*/
|
||||
intlTelInput(method: 'getNumber'): string;
|
||||
/**
|
||||
* Get the type (fixed-line/mobile/toll-free etc) of the current number.
|
||||
* Requires the utilsScript option.
|
||||
* Returns an integer, which you can match against the various options in the
|
||||
* global enum intlTelInputUtils.numberType.
|
||||
* Note that in the US there's no way to differentiate between fixed-line and
|
||||
* mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE.
|
||||
*/
|
||||
intlTelInput(method: 'getNumberType'): intlTelInputUtils.numberType;
|
||||
/**
|
||||
* Get the country data for the currently selected flag.
|
||||
*/
|
||||
intlTelInput(method: 'getSelectedCountryData'): IntlTelInput.CountryData;
|
||||
/**
|
||||
* Get more information about a validation error.
|
||||
* Requires the utilsScript option.
|
||||
* Returns an integer, which you can match against the various options in the
|
||||
* global enum intlTelInputUtils.validationError
|
||||
*/
|
||||
intlTelInput(method: 'getValidationError'): intlTelInputUtils.validationError;
|
||||
/**
|
||||
* Validate the current number. Expects an internationally formatted number
|
||||
* (unless nationalMode is enabled). If validation fails, you can use
|
||||
* getValidationError to get more information.
|
||||
* Requires the utilsScript option.
|
||||
* Also see getNumberType if you want to make sure the user enters a certain
|
||||
* type of number e.g. a mobile number.
|
||||
*/
|
||||
intlTelInput(method: 'isValidNumber'): boolean;
|
||||
intlTelInput(method: string): void;
|
||||
/**
|
||||
* Change the country selection (e.g. when the user is entering their address).
|
||||
* @param countryCode country code of the country to be set.
|
||||
*/
|
||||
intlTelInput(method: 'setCountry', countryCode: string): void;
|
||||
/**
|
||||
* Insert a number, and update the selected flag accordingly.
|
||||
* Note that by default, if nationalMode is enabled it will try to use
|
||||
* national formatting.
|
||||
* @param aNumber number to be set.
|
||||
*/
|
||||
intlTelInput(method: 'setNumber', aNumber: string): void;
|
||||
intlTelInput(method: string, value: string): void;
|
||||
|
||||
/**
|
||||
* Get the current number in the given format (defaults to E.164 standard).
|
||||
* The different formats are available in the enum
|
||||
* intlTelInputUtils.numberFormat - taken from here.
|
||||
* Requires the utilsScript option.
|
||||
* Note that even if nationalMode is enabled, this can still return a full
|
||||
* international number.
|
||||
* @param numberFormat the format in which the number will be returned.
|
||||
*/
|
||||
intlTelInput(method: 'getNumber', numberFormat: intlTelInputUtils.numberFormat): string;
|
||||
intlTelInput(method: string, numberFormat: intlTelInputUtils.numberFormat): string;
|
||||
|
||||
/**
|
||||
* initialise the plugin with optional options.
|
||||
* @param options options that can be provided during initialization.
|
||||
*/
|
||||
intlTelInput(options?: IntlTelInput.Options): JQueryDeferred<any>;
|
||||
}
|
||||
@@ -5,11 +5,14 @@ import { JavaScriptObfuscator } from 'javascript-obfuscator';
|
||||
let sourceCode1: string = JavaScriptObfuscator.obfuscate('var foo = 1;');
|
||||
let sourceCode2: string = JavaScriptObfuscator.obfuscate('var foo = 1;', {
|
||||
compact: true,
|
||||
debugProtection: false,
|
||||
debugProtectionInterval: false,
|
||||
disableConsoleOutput: true,
|
||||
encodeUnicodeLiterals: true,
|
||||
rotateUnicodeArray: true,
|
||||
unicodeArray: true,
|
||||
wrapUnicodeArrayCalls: true
|
||||
debugProtection: false,
|
||||
debugProtectionInterval: false,
|
||||
disableConsoleOutput: true,
|
||||
encodeUnicodeLiterals: false,
|
||||
reservedNames: ['^foo$'],
|
||||
rotateUnicodeArray: true,
|
||||
selfDefending: true,
|
||||
unicodeArray: true,
|
||||
unicodeArrayThreshold: 0.8,
|
||||
wrapUnicodeArrayCalls: true
|
||||
});
|
||||
|
||||
@@ -10,8 +10,11 @@ declare module 'javascript-obfuscator' {
|
||||
debugProtectionInterval?: boolean;
|
||||
disableConsoleOutput?: boolean;
|
||||
encodeUnicodeLiterals?: boolean;
|
||||
reservedNames?: string[];
|
||||
rotateUnicodeArray?: boolean;
|
||||
selfDefending?: boolean;
|
||||
unicodeArray?: boolean;
|
||||
unicodeArrayThreshold?: number;
|
||||
wrapUnicodeArrayCalls?: boolean;
|
||||
[id: string]: any;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3
|
||||
// Project: http://aspnetwebstack.codeplex.com/
|
||||
// Project: https://github.com/aspnet/jquery-validation-unobtrusive
|
||||
// Definitions by: Matt Brooks <https://github.com/EnableSoftware>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -41,6 +41,21 @@ $('#slimtest3').slimScroll({
|
||||
alwaysVisible: true
|
||||
});
|
||||
|
||||
$('#slimtest3').slimScroll({
|
||||
color: '#00f',
|
||||
size: '10px',
|
||||
height: '180px',
|
||||
alwaysVisible: true,
|
||||
destroy: true
|
||||
});
|
||||
|
||||
$("div").slimScroll().bind('slimscroll', function(e){
|
||||
console.log("Reached " + e);
|
||||
});
|
||||
});
|
||||
|
||||
var options : IJQuerySlimScrollOptions = {
|
||||
destroy: true,
|
||||
position: 'left'
|
||||
};
|
||||
|
||||
$('#slimtest3').slimScroll(options);
|
||||
|
||||
+77
-25
@@ -1,58 +1,110 @@
|
||||
// Type definitions for jQuery.slimScroll v1.3.3
|
||||
// Type definitions for jQuery.slimScroll v1.3.8
|
||||
// Project: https://github.com/rochal/jQuery-slimScroll
|
||||
// Definitions by: Chintan Shah <https://github.com/Promact>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface IJQuerySlimScrollOptions {
|
||||
// width in pixels of the visible scroll area
|
||||
/**
|
||||
* width in pixels of the visible scroll area
|
||||
*/
|
||||
width? :string;
|
||||
// height in pixels of the visible scroll area
|
||||
/**
|
||||
* height in pixels of the visible scroll area
|
||||
*/
|
||||
height? :string;
|
||||
// width in pixels of the scrollbar and rail
|
||||
/**
|
||||
* width in pixels of the scrollbar and rail
|
||||
*/
|
||||
size? :string;
|
||||
// scrollbar color, accepts any hex/color value
|
||||
/**
|
||||
* scrollbar color, accepts any hex/color value
|
||||
*/
|
||||
color?:string;
|
||||
// scrollbar position - left/right
|
||||
/**
|
||||
* scrollbar position - left/right
|
||||
*/
|
||||
position?:string;
|
||||
// distance in pixels between the side edge and the scrollbar
|
||||
/**
|
||||
* distance in pixels between the side edge and the scrollbar
|
||||
*/
|
||||
distance?:string;
|
||||
// default scroll position on load - top / bottom / $('selector')
|
||||
/**
|
||||
* default scroll position on load - top / bottom / $('selector')
|
||||
*/
|
||||
start?:any;
|
||||
// sets scrollbar opacity
|
||||
/**
|
||||
* sets scrollbar opacity
|
||||
*/
|
||||
opacity? :number;
|
||||
// enables always-on mode for the scrollbar
|
||||
/**
|
||||
* enables always-on mode for the scrollbar
|
||||
*/
|
||||
alwaysVisible?: boolean;
|
||||
// check if we should hide the scrollbar when user is hovering over
|
||||
/**
|
||||
* check if we should hide the scrollbar when user is hovering over
|
||||
*/
|
||||
disableFadeOut?: boolean;
|
||||
// sets visibility of the rail
|
||||
/**
|
||||
* sets visibility of the rail
|
||||
*/
|
||||
railVisible?: boolean;
|
||||
// sets rail color
|
||||
/**
|
||||
* sets rail color
|
||||
*/
|
||||
railColor?: string;
|
||||
// sets rail opacity
|
||||
/**
|
||||
* sets rail opacity
|
||||
*/
|
||||
railOpacity?:number;
|
||||
// whether we should use jQuery UI Draggable to enable bar dragging
|
||||
/**
|
||||
* whether we should use jQuery UI Draggable to enable bar dragging
|
||||
*/
|
||||
railDraggable?: boolean;
|
||||
// defautlt CSS class of the slimscroll rail
|
||||
/**
|
||||
* default CSS class of the slimscroll rail
|
||||
*/
|
||||
railClass?: string;
|
||||
// defautlt CSS class of the slimscroll bar
|
||||
/**
|
||||
* default CSS class of the slimscroll bar
|
||||
*/
|
||||
barClass?: string;
|
||||
// defautlt CSS class of the slimscroll wrapper
|
||||
/**
|
||||
* default CSS class of the slimscroll wrapper
|
||||
*/
|
||||
wrapperClass?: string;
|
||||
// check if mousewheel should scroll the window if we reach top/bottom
|
||||
/**
|
||||
* check if mousewheel should scroll the window if we reach top/bottom
|
||||
*/
|
||||
allowPageScroll?: boolean;
|
||||
// scroll amount applied to each mouse wheel step
|
||||
/**
|
||||
* scroll amount applied to each mouse wheel step
|
||||
*/
|
||||
wheelStep?: number;
|
||||
// scroll amount applied when user is using gestures
|
||||
/**
|
||||
* scroll amount applied when user is using gestures
|
||||
*/
|
||||
touchScrollStep?: number;
|
||||
// sets border radius
|
||||
/**
|
||||
* sets border radius
|
||||
*/
|
||||
borderRadius?: string;
|
||||
// sets border radius of the rail
|
||||
/**
|
||||
* sets border radius of the rail
|
||||
*/
|
||||
railBorderRadius?: string;
|
||||
// jumps to the specified scroll value
|
||||
/**
|
||||
* jumps to the specified scroll value
|
||||
*/
|
||||
scrollTo?: string;
|
||||
// increases/decreases current scroll value by specified amount
|
||||
/**
|
||||
* increases/decreases current scroll value by specified amount
|
||||
*/
|
||||
scrollBy?: string;
|
||||
/**
|
||||
* release resources held by the plugin
|
||||
*/
|
||||
destroy?:boolean;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
Vendored
+18
@@ -1987,6 +1987,24 @@ interface JQuery {
|
||||
*/
|
||||
click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
||||
|
||||
/**
|
||||
* Trigger the "contextmenu" event on an element.
|
||||
*/
|
||||
contextmenu(): JQuery;
|
||||
/**
|
||||
* Bind an event handler to the "contextmenu" JavaScript event.
|
||||
*
|
||||
* @param handler A function to execute when the event is triggered.
|
||||
*/
|
||||
contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
||||
/**
|
||||
* Bind an event handler to the "contextmenu" JavaScript event.
|
||||
*
|
||||
* @param eventData An object containing data that will be passed to the event handler.
|
||||
* @param handler A function to execute when the event is triggered.
|
||||
*/
|
||||
contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
||||
|
||||
/**
|
||||
* Trigger the "dblclick" event on an element.
|
||||
*/
|
||||
|
||||
Vendored
+2
@@ -1282,6 +1282,7 @@ declare namespace kendo.data {
|
||||
|
||||
interface DataSourceRequestStartEvent extends DataSourceEvent {
|
||||
type?: string;
|
||||
preventDefault(): void;
|
||||
}
|
||||
|
||||
interface DataSourceRequestEndEvent extends DataSourceEvent {
|
||||
@@ -3334,6 +3335,7 @@ declare namespace kendo.ui {
|
||||
static fn: DropDownList;
|
||||
|
||||
options: DropDownListOptions;
|
||||
popup: kendo.ui.Popup;
|
||||
|
||||
dataSource: kendo.data.DataSource;
|
||||
span: JQuery;
|
||||
|
||||
@@ -26,6 +26,9 @@ function main() {
|
||||
endpoint.installationID;
|
||||
});
|
||||
|
||||
user.setLocale("en");
|
||||
var locale: string = user.getLocale();
|
||||
|
||||
var anotherUser: KiiUser = KiiUserBuilder
|
||||
.builderWithIdentifier("id", "password")
|
||||
.setEmailAddress("mail@example.org")
|
||||
@@ -67,4 +70,30 @@ function main() {
|
||||
removeMembersArray: KiiUser[]) {
|
||||
}
|
||||
});
|
||||
|
||||
Kii.authenticateAsThing("thing id", "password", {
|
||||
success: function (thingAuthContext: KiiThingContext) {
|
||||
thingAuthContext.bucketWithName("");
|
||||
},
|
||||
failure: function (error) {
|
||||
}
|
||||
})
|
||||
.then(function (thingAuthContext: KiiThingContext) {
|
||||
});
|
||||
|
||||
Kii.authenticateAsThingWithToken("thing id", "token", {
|
||||
success: function (thingAuthContext: KiiThingContext) {
|
||||
thingAuthContext.bucketWithName("");
|
||||
},
|
||||
failure: function (error) {
|
||||
}
|
||||
})
|
||||
.then(function (thingAuthContext: KiiThingContext) {
|
||||
});
|
||||
|
||||
KiiThing.loadWithVendorThingID("thing ID")
|
||||
.then(function (thing) {
|
||||
var isOnline: boolean = thing.isOnline();
|
||||
var onlineStatusModifiedAt: Date = thing.getOnlineStatusModifiedAt();
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+289
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Kii Cloud SDK v2.4.4
|
||||
// Type definitions for Kii Cloud SDK v2.4.6
|
||||
// Project: http://en.kii.com/
|
||||
// Definitions by: Kii Consortium <http://jp.kii.com/consortium/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -17,7 +17,8 @@ declare namespace KiiCloud {
|
||||
JP,
|
||||
CN,
|
||||
SG,
|
||||
CN3
|
||||
CN3,
|
||||
EU
|
||||
}
|
||||
|
||||
export enum KiiAnalyticsSite {
|
||||
@@ -25,7 +26,8 @@ declare namespace KiiCloud {
|
||||
JP,
|
||||
CN,
|
||||
SG,
|
||||
CN3
|
||||
CN3,
|
||||
EU
|
||||
}
|
||||
|
||||
enum KiiSocialNetworkName {
|
||||
@@ -512,6 +514,104 @@ declare namespace KiiCloud {
|
||||
* );
|
||||
*/
|
||||
static listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
|
||||
|
||||
/**
|
||||
* Authenticate as Thing.
|
||||
* <br><br>
|
||||
* <b>This api is intended to be used in a Thing device, where the user
|
||||
* credentials or app admin context is not configured. This Thing must be
|
||||
* already registered in Kii Cloud.
|
||||
* </b>
|
||||
*
|
||||
* @param vendorThingID vendorThingID of a registered Thing.
|
||||
* @param password password for the registered Thing.
|
||||
* @param callbacks The callback methods called when authentication succeeded/failed.
|
||||
*
|
||||
* @return return promise object.
|
||||
* <ul>
|
||||
* <li>fulfill callback function: function(thingAuthContext). thingAuthContext is a KiiThingContext instance.</li>
|
||||
* <li>reject callback function: function(error). error is an Error instance.
|
||||
* <ul>
|
||||
* <li>error.message</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* @example
|
||||
* // example to use callbacks directly
|
||||
* Kii.authenticateAsThing("vendor thing id", "password of this thing", {
|
||||
* success: function(thingAuthContext) {
|
||||
* // thingAuthContext : KiiThingContext instance
|
||||
* // Operate entities with thingAuthContext.
|
||||
* },
|
||||
* failure: function(error) {
|
||||
* // Authentication failed.
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // example to use Promise
|
||||
* Kii.authenticateAsThing("vendor thing id", "password of this thing").then(
|
||||
* function(thingAuthContext) { // fulfill callback function
|
||||
* // thingAuthContext : KiiThingContext instance
|
||||
* // Operate entities with thingAuthContext.
|
||||
*
|
||||
* },
|
||||
* function(error) { // reject callback function
|
||||
* // Authentication failed.
|
||||
* var errorString = error.message;
|
||||
* }
|
||||
* );
|
||||
*/
|
||||
static authenticateAsThing(vendorThingID: string, password: string, callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; }): Promise<KiiThingContext>;
|
||||
|
||||
/**
|
||||
* Create a KiiThingContext reference
|
||||
* <br><br>
|
||||
* <b>This api is intended to be used in a Thing device, where the user
|
||||
* credentials or app admin context is not configured. This Thing must be
|
||||
* already registered in Kii Cloud.
|
||||
* </b>
|
||||
*
|
||||
* @param thingID thingID of a registered Thing.
|
||||
* @param token token for the registered Thing.
|
||||
* @param callbacks The callback methods called when creation succeeded/failed.
|
||||
*
|
||||
* @return return promise object.
|
||||
* <ul>
|
||||
* <li>fulfill callback function: function(thingContext). thingContext is a KiiThingContext instance.</li>
|
||||
* <li>reject callback function: function(error). error is an Error instance.
|
||||
* <ul>
|
||||
* <li>error.message</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* @example
|
||||
* // example to use callbacks directly
|
||||
* Kii.authenticateAsThingWithToken("thing_id", "thing_token", {
|
||||
* success: function(thingContext) {
|
||||
* // thingContext : KiiThingContext instance
|
||||
* // Operate entities with thingContext.
|
||||
* },
|
||||
* failure: function(error) {
|
||||
* // Creation failed.
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // example to use Promise
|
||||
* Kii.authenticateAsThingWithToken("thing_id", "thing_token").then(
|
||||
* function(thingContext) { // fulfill callback function
|
||||
* // thingContext : KiiThingContext instance
|
||||
* // Operate entities with thingContext.
|
||||
*
|
||||
* },
|
||||
* function(error) { // reject callback function
|
||||
* // Creation failed.
|
||||
* var errorString = error.message;
|
||||
* }
|
||||
* );
|
||||
*/
|
||||
static authenticateAsThingWithToken(thingID: string, token: string, callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; }): Promise<KiiThingContext>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3744,7 +3844,7 @@ declare namespace KiiCloud {
|
||||
* <li>response.username is username to use for connecting to the MQTT broker.</li>
|
||||
* <li>response.password is assword to use for connecting to the MQTT broker.</li>
|
||||
* <li>response.mqttTopic is topic to subscribe in the MQTT broker.</li>
|
||||
* <li>response.host is URL of the MQTT broker host to connect.</li>
|
||||
* <li>response.host is hostname of the MQTT broker.</li>
|
||||
* <li>response.X-MQTT-TTL is the amount of time in seconds that specifies how long the mqttTopic will be valid, after that the client needs to request new MQTT endpoint info.</li>
|
||||
* <li>response.portTCP is port to connect using plain TCP.</li>
|
||||
* <li>response.portSSL is port to connect using SSL/TLS.</li>
|
||||
@@ -4986,6 +5086,20 @@ declare namespace KiiCloud {
|
||||
*/
|
||||
getDisabled(): boolean;
|
||||
|
||||
/**
|
||||
* Get online status of the thing.
|
||||
*
|
||||
* @return true if the thing is online, false otherwise. The return value will be null initially until the thing is connected for the first time.
|
||||
*/
|
||||
isOnline(): boolean;
|
||||
|
||||
/**
|
||||
* Get online status modified date of the thing.
|
||||
*
|
||||
* @return online status modified time of this thing. The date will be null initially until the thing is connected for the first time.
|
||||
*/
|
||||
getOnlineStatusModifiedAt(): Date;
|
||||
|
||||
/**
|
||||
* Register thing in KiiCloud.<br>
|
||||
* This API doesnt require users login Anonymous user can register thing.
|
||||
@@ -5794,6 +5908,156 @@ declare namespace KiiCloud {
|
||||
pushSubscription(): KiiPushSubscription;
|
||||
}
|
||||
|
||||
/**
|
||||
* represents a KiiThingContext object
|
||||
*/
|
||||
export class KiiThingContext {
|
||||
/**
|
||||
* Creates a reference to a bucket in App scope operated by thing.
|
||||
*
|
||||
* @param bucketName The name of the bucket the app should create/access
|
||||
*
|
||||
* @return A working KiiBucket object
|
||||
*
|
||||
* @example
|
||||
* Kii.authenticateAsThing("vendorThingID", "password", {
|
||||
* success: function(thingAuthContext) {
|
||||
* var bucket = thingAuthContext.bucketWithName("myAppBucket");
|
||||
* },
|
||||
* failure: function(errorString, errorCode) {
|
||||
* // auth failed.
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
bucketWithName(bucketName: string): KiiBucket;
|
||||
|
||||
/**
|
||||
* Creates a reference to a encrypted bucket in App scope operated by thing.
|
||||
* <br><br>The bucket will be created/accessed within this app's scope
|
||||
*
|
||||
* @param bucketName The name of the bucket the app should create/access
|
||||
*
|
||||
* @return A working KiiBucket object
|
||||
*
|
||||
* @example
|
||||
* Kii.authenticateAsThing("vendorThingID", "password", {
|
||||
* success: function(thingAuthContext) {
|
||||
* var bucket = thingAuthContext.encryptedBucketWithName("myAppBucket");
|
||||
* },
|
||||
* failure: function(errorString, errorCode) {
|
||||
* // auth failed.
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
encryptedBucketWithName(bucketName: string): KiiBucket;
|
||||
|
||||
/**
|
||||
* Creates a reference to an object operated by thing using object`s URI.
|
||||
*
|
||||
* @param object URI.
|
||||
*
|
||||
* @return A working KiiObject instance
|
||||
*
|
||||
* @throws If the URI is null, empty or does not have correct format.
|
||||
*/
|
||||
objectWithURI(object: string): KiiObject;
|
||||
|
||||
/**
|
||||
* Creates a reference to a topic in App scope operated by thing.
|
||||
* <br><br>The Topic will be created/accessed within this app's scope
|
||||
*
|
||||
* @param topicName name of the topic. Must be a not empty string.
|
||||
*
|
||||
* @return topic instance.
|
||||
*/
|
||||
topicWithName(topicName: string): KiiTopic;
|
||||
|
||||
/**
|
||||
* Gets a list of topics in app scope
|
||||
*
|
||||
* @param callbacks An object with callback methods defined
|
||||
* @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
|
||||
*
|
||||
* @return return promise object.
|
||||
* <ul>
|
||||
* <li>fulfill callback function: function(params). params is Array instance.
|
||||
* <ul>
|
||||
* <li>params[0] is array of KiiTopic instances.</li>
|
||||
* <li>params[1] is string of nextPaginationKey.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>reject callback function: function(error). error is an Error instance.
|
||||
* <ul>
|
||||
* <li>error.target is a KiiAppAdminContext instance which this method was called on.</li>
|
||||
* <li>error.message</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* @example
|
||||
* // example to use callbacks directly
|
||||
* // Assume you already have thingAuthContext instance.
|
||||
* thingAuthContext.listTopics({
|
||||
* success: function(topicList, nextPaginationKey) {
|
||||
* // do something with the result
|
||||
* for(var i=0; i<topicList.length; i++){
|
||||
* var topic = topicList[i];
|
||||
* }
|
||||
* if (nextPaginationKey != null) {
|
||||
* thingAuthContext.listTopics({
|
||||
* success: function(topicList, nextPaginationKey) {...},
|
||||
* failure: function(anErrorString) {...}
|
||||
* }, nextPaginationKey);
|
||||
* }
|
||||
* },
|
||||
* failure: function(anErrorString) {
|
||||
* // do something with the error response
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // example to use Promise
|
||||
* // Assume you already have thingAuthContext instance.
|
||||
* thingAuthContext.listTopics().then(
|
||||
* function(params) {
|
||||
* var topicList = params[0];
|
||||
* var nextPaginationKey = params[1];
|
||||
* // do something with the result
|
||||
* for(var i=0; i<topicList.length; i++){
|
||||
* var topic = topicList[i];
|
||||
* }
|
||||
* if (nextPaginationKey != null) {
|
||||
* thingAuthContext.listTopics(null, nextPaginationKey).then(
|
||||
* function(params) {...},
|
||||
* function(error) {...}
|
||||
* );
|
||||
* }
|
||||
* },
|
||||
* function(error) {
|
||||
* // do something with the error response
|
||||
* }
|
||||
* );
|
||||
*/
|
||||
listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
|
||||
|
||||
/**
|
||||
* Gets authenticated KiiThing instance.
|
||||
* <br>Returned thing instance only have thingID, vendorThingID and accessToken.
|
||||
* (vendorThingID is not included when you used
|
||||
* {@link Kii.authenticateAsThingWithToken()} to obtain KiiThingContext.)
|
||||
* <br>Please execute {@link KiiThing#refresh()} to obtain other properties.
|
||||
*
|
||||
* @return return authenticated KiiThing instance.
|
||||
*/
|
||||
getAuthenticatedThing(): KiiThing;
|
||||
|
||||
/**
|
||||
* Instantiate push installation for this thing.
|
||||
*
|
||||
* @return push installation object.
|
||||
*/
|
||||
pushInstallation(): KiiPushInstallation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Topic object.
|
||||
*/
|
||||
@@ -6106,6 +6370,25 @@ declare namespace KiiCloud {
|
||||
*/
|
||||
setCountry(value: string): void;
|
||||
|
||||
/**
|
||||
* Get the locale associated with this user
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
getLocale(): string;
|
||||
|
||||
/**
|
||||
* Set the locale associated with this user
|
||||
* The locale argument must be BCP 47 language tag.
|
||||
* Examples:
|
||||
* "en": English
|
||||
* "de-AT": German as used in Austria.
|
||||
* "zh-Hans-CN": Chinese written in simplified characters as used in China.
|
||||
*
|
||||
* @param value The locale to set.
|
||||
*/
|
||||
setLocale(value: string): void;
|
||||
|
||||
/**
|
||||
* Get the server's creation date of this user
|
||||
*
|
||||
@@ -6196,7 +6479,7 @@ declare namespace KiiCloud {
|
||||
/**
|
||||
* Sets a key/value pair to a KiiUser
|
||||
*
|
||||
* <br><br>If the key already exists, its value will be written over. If the object is of invalid type, it will return false and a KiiError will be thrown (quietly). Accepted types are any JSON-encodable objects.
|
||||
* <br><br>If the key already exists, its value will be written over. If key is empty or starting with '_', it will do nothing. Accepted types are any JSON-encodable objects.
|
||||
*
|
||||
* @param key The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_)
|
||||
* @param value The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc)
|
||||
@@ -7826,6 +8109,7 @@ import KiiServerCodeEntry = KiiCloud.KiiServerCodeEntry;
|
||||
import KiiServerCodeExecResult = KiiCloud.KiiServerCodeExecResult;
|
||||
import KiiSocialConnect = KiiCloud.KiiSocialConnect;
|
||||
import KiiThing = KiiCloud.KiiThing;
|
||||
import KiiThingContext = KiiCloud.KiiThingContext;
|
||||
import KiiTopic = KiiCloud.KiiTopic;
|
||||
import KiiUser = KiiCloud.KiiUser;
|
||||
import KiiUserBuilder = KiiCloud.KiiUserBuilder;
|
||||
|
||||
@@ -162,6 +162,8 @@ knex.select('*').from('users').join('accounts', function() {
|
||||
|
||||
knex.select('*').from('users').join('accounts', 'accounts.type', knex.raw('?', ['admin']));
|
||||
|
||||
knex.raw('select * from users where id = :user_id', { user_id: 1 });
|
||||
|
||||
knex.from('users').innerJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.table('users').innerJoin('accounts', 'users.id', '=', 'accounts.user_id');
|
||||
|
||||
Vendored
+4
@@ -31,6 +31,7 @@ declare module "knex" {
|
||||
migrate: Knex.Migrator;
|
||||
seed: any;
|
||||
fn: any;
|
||||
on(eventName: string, callback: Function): Knex.QueryBuilder;
|
||||
}
|
||||
|
||||
function Knex(config: Knex.Config) : Knex;
|
||||
@@ -249,6 +250,7 @@ declare module "knex" {
|
||||
(value: Value): Raw;
|
||||
(sql: string, ...bindings: Value[]): Raw;
|
||||
(sql: string, bindings: Value[]): Raw;
|
||||
(sql: string, bindings: Object): Raw;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -301,6 +303,7 @@ declare module "knex" {
|
||||
|
||||
interface SchemaBuilder extends Promise<any> {
|
||||
createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder;
|
||||
createTableIfNotExists(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder;
|
||||
renameTable(oldTableName: string, newTableName: string): Promise<void>;
|
||||
dropTable(tableName: string): SchemaBuilder;
|
||||
hasTable(tableName: string): Promise<boolean>;
|
||||
@@ -312,6 +315,7 @@ declare module "knex" {
|
||||
|
||||
interface TableBuilder {
|
||||
increments(columnName?: string): ColumnBuilder;
|
||||
bigIncrements(columnName?: string): ColumnBuilder;
|
||||
dropColumn(columnName: string): TableBuilder;
|
||||
dropColumns(...columnNames: string[]): TableBuilder;
|
||||
renameColumn(from: string, to: string): ColumnBuilder;
|
||||
|
||||
Vendored
+213
-136
@@ -6,192 +6,270 @@
|
||||
// These are very definitely preliminary. Please feel free to improve.
|
||||
|
||||
/// <reference path="../knockout/knockout.d.ts" />
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace kg {
|
||||
interface DomUtilityService {
|
||||
UpdateGridLayout(grid: Grid<any>): void;
|
||||
BuildStyles(grid: Grid<any>): void;
|
||||
}
|
||||
interface DomUtilityService {
|
||||
UpdateGridLayout(grid: Grid<any>): void;
|
||||
BuildStyles(grid: Grid<any>): void;
|
||||
}
|
||||
|
||||
interface Row<EntityType> {
|
||||
selected: KnockoutObservable<boolean>;
|
||||
entity: EntityType;
|
||||
}
|
||||
interface Row<EntityType> {
|
||||
selected: KnockoutObservable<boolean>;
|
||||
entity: EntityType;
|
||||
}
|
||||
|
||||
interface RowFactory<EntityType> {
|
||||
rowCache: Row<EntityType>[];
|
||||
}
|
||||
interface RowFactory<EntityType> {
|
||||
rowCache: Row<EntityType>[];
|
||||
}
|
||||
|
||||
interface SelectionService<EntityType> {
|
||||
setSelection(row: Row<EntityType>, selected: boolean): void;
|
||||
multi: boolean;
|
||||
lastClickedRow: Row<EntityType>;
|
||||
}
|
||||
interface SelectionService<EntityType> {
|
||||
setSelection(row: Row<EntityType>, selected: boolean): void;
|
||||
multi: boolean;
|
||||
lastClickedRow: Row<EntityType>;
|
||||
}
|
||||
|
||||
interface Grid<EntityType> {
|
||||
configureColumnWidths(): void;
|
||||
rowFactory: RowFactory<EntityType>;
|
||||
config: GridOptions<EntityType>;
|
||||
$$selectionPhase: boolean;
|
||||
selectionService: SelectionService<EntityType>;
|
||||
}
|
||||
interface Grid<EntityType> {
|
||||
configureColumnWidths(): void;
|
||||
rowFactory: RowFactory<EntityType>;
|
||||
config: GridOptions<EntityType>;
|
||||
$$selectionPhase: boolean;
|
||||
selectionService: SelectionService<EntityType>;
|
||||
}
|
||||
|
||||
interface Plugin<EntityType> {
|
||||
onGridInit(grid: Grid<EntityType>): void;
|
||||
}
|
||||
interface Plugin<EntityType> {
|
||||
onGridInit(grid: Grid<EntityType>): void;
|
||||
}
|
||||
|
||||
interface GridOptions<EntityType> {
|
||||
/** Callback for when you want to validate something after selection. */
|
||||
afterSelectionChange?(row: Row<EntityType>): void;
|
||||
interface GridOptions<EntityType> {
|
||||
/** Callback for when you want to validate something after selection. */
|
||||
afterSelectionChange?(row: Row<EntityType>): void;
|
||||
|
||||
/** Callback if you want to inspect something before selection,
|
||||
return false if you want to cancel the selection. return true otherwise.
|
||||
If you need to wait for an async call to proceed with selection you can
|
||||
use rowItem.changeSelection(event) method after returning false initially.
|
||||
Note: when shift+ Selecting multiple items in the grid this will only get called
|
||||
once and the rowItem will be an array of items that are queued to be selected. */
|
||||
beforeSelectionChange?: Function;
|
||||
/** Callback if you want to inspect something before selection,
|
||||
return false if you want to cancel the selection. return true otherwise.
|
||||
If you need to wait for an async call to proceed with selection you can
|
||||
use rowItem.changeSelection(event) method after returning false initially.
|
||||
Note: when shift+ Selecting multiple items in the grid this will only get called
|
||||
once and the rowItem will be an array of items that are queued to be selected. */
|
||||
beforeSelectionChange?(row: Row<EntityType>): boolean;
|
||||
|
||||
/** definitions of columns as an array [], if not defined columns are auto-generated. See github wiki for more details. */
|
||||
columnDefs?: ColumnDef[];
|
||||
/** To be able to have selectable rows in grid. */
|
||||
canSelectRows?:boolean;
|
||||
|
||||
/** Column width of columns in grid. */
|
||||
columnWidth?: number;
|
||||
/** definitions of columns as an array [], if not defined columns are auto-generated. See github wiki for more details. */
|
||||
columnDefs?: ColumnDef[] | KnockoutObservable<ColumnDef[]>;
|
||||
|
||||
/** Data being displayed in the grid. Each item in the array is mapped to a row being displayed. */
|
||||
data?: KnockoutObservableArray<EntityType>;
|
||||
/** Column width of columns in grid. */
|
||||
columnWidth?: number;
|
||||
|
||||
/** Row selection check boxes appear as the first column. */
|
||||
displaySelectionCheckbox: boolean;
|
||||
/** Data being displayed in the grid. Each item in the array is mapped to a row being displayed. */
|
||||
data?: KnockoutObservableArray<EntityType>;
|
||||
|
||||
/** Enable or disable resizing of columns */
|
||||
enableColumnResize?: boolean;
|
||||
/** Row selection check boxes appear as the first column. */
|
||||
displaySelectionCheckbox: boolean;
|
||||
|
||||
/** Enables the server-side paging feature */
|
||||
enablePaging?: boolean;
|
||||
/** Enable or disable resizing of columns */
|
||||
enableColumnResize?: boolean;
|
||||
|
||||
/** Enable column pinning */
|
||||
enablePinning?: boolean;
|
||||
/** Enables the server-side paging feature */
|
||||
enablePaging?: boolean;
|
||||
|
||||
/** Enable drag and drop row reordering. Only works in HTML5 compliant browsers. */
|
||||
enableRowReordering?: boolean;
|
||||
/** Enable drag and drop row reordering. Only works in HTML5 compliant browsers. */
|
||||
enableRowReordering?: boolean;
|
||||
|
||||
/** To be able to have selectable rows in grid. */
|
||||
enableRowSelection?: boolean;
|
||||
/** Enables or disables sorting in grid. */
|
||||
enableSorting?: boolean;
|
||||
|
||||
/** Enables or disables sorting in grid. */
|
||||
enableSorting?: boolean;
|
||||
/** filterOptions -
|
||||
filterText: The text bound to the built-in search box.
|
||||
useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box.
|
||||
*/
|
||||
filterOptions?: FilterOptions;
|
||||
|
||||
/** filterOptions -
|
||||
filterText: The text bound to the built-in search box.
|
||||
useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box.
|
||||
*/
|
||||
filterOptions?: FilterOptions;
|
||||
/** Defining the height of the footer in pixels. */
|
||||
footerRowHeight?: number;
|
||||
|
||||
/** Defining the height of the footer in pixels. */
|
||||
footerRowHeight?: number;
|
||||
/** Show or hide the footer alltogether the footer is enabled by default */
|
||||
footerVisible?: boolean;
|
||||
|
||||
/** Show or hide the footer alltogether the footer is enabled by default */
|
||||
footerVisible?: boolean;
|
||||
/** Initial fields to group data by. Array of field names, not displayName. */
|
||||
groups?: string[];
|
||||
|
||||
/** Initial fields to group data by. Array of field names, not displayName. */
|
||||
groups?: string[];
|
||||
/** The height of the header row in pixels. */
|
||||
headerRowHeight?: number;
|
||||
|
||||
/** The height of the header row in pixels. */
|
||||
headerRowHeight?: number;
|
||||
/** Define a header row template for further customization. See github wiki for more details. */
|
||||
headerRowTemplate?: string | JQueryGenericPromise<string>;
|
||||
|
||||
/** Define a header row template for further customization. See github wiki for more details. */
|
||||
headerRowTemplate?: any;
|
||||
/** Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled.
|
||||
Useful if you want drag + drop but your users insist on crappy browsers. */
|
||||
jqueryUIDraggable?: boolean;
|
||||
|
||||
/** Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled.
|
||||
Useful if you want drag + drop but your users insist on crappy browsers. */
|
||||
jqueryUIDraggable?: boolean;
|
||||
/** Enable the use jqueryUIThemes */
|
||||
jqueryUITheme?: boolean;
|
||||
|
||||
/** Enable the use jqueryUIThemes */
|
||||
jqueryUITheme?: boolean;
|
||||
/** Prevent unselections when in single selection mode. */
|
||||
keepLastSelected?: boolean;
|
||||
|
||||
/** Prevent unselections when in single selection mode. */
|
||||
keepLastSelected?: boolean;
|
||||
/** Maintains the column widths while resizing.
|
||||
Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false. */
|
||||
maintainColumnRatios?: any;
|
||||
|
||||
/** Maintains the column widths while resizing.
|
||||
Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false. */
|
||||
maintainColumnRatios?: any;
|
||||
/** Set this to false if you only want one item selected at a time */
|
||||
multiSelect?: boolean;
|
||||
|
||||
/** Set this to false if you only want one item selected at a time */
|
||||
multiSelect?: boolean;
|
||||
/** pagingOptions - */
|
||||
pagingOptions?: PagingOptions;
|
||||
|
||||
/** pagingOptions - */
|
||||
pagingOptions?: PagingOptions;
|
||||
/** Array of plugin functions to register in ng-grid */
|
||||
plugins?: Plugin<EntityType>[];
|
||||
|
||||
/** Array of plugin functions to register in ng-grid */
|
||||
plugins?: Plugin<EntityType>[];
|
||||
/** Row height of rows in grid. */
|
||||
rowHeight?: number;
|
||||
|
||||
/** Row height of rows in grid. */
|
||||
rowHeight?: number;
|
||||
/** Define a row template to customize output. See github wiki for more details. */
|
||||
rowTemplate?: string | JQueryGenericPromise<string>;
|
||||
|
||||
/** Define a row template to customize output. See github wiki for more details. */
|
||||
rowTemplate?: any;
|
||||
/** Defines the binding to select all at once */
|
||||
selectAllState?: KnockoutObservable<boolean>;
|
||||
|
||||
/** all of the items selected in the grid. In single select mode there will only be one item in the array. */
|
||||
selectedItems?: KnockoutObservableArray<any>;
|
||||
/** all of the items selected in the grid. In single select mode there will only be one item in the array. */
|
||||
selectedItems?: KnockoutObservableArray<any>;
|
||||
|
||||
/** Disable row selections by clicking on the row and only when the checkbox is clicked. */
|
||||
selectWithCheckboxOnly?: boolean;
|
||||
/** Disable row selections by clicking on the row and only when the checkbox is clicked. */
|
||||
selectWithCheckboxOnly?: boolean;
|
||||
|
||||
/** Enables menu to choose which columns to display and group by.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showColumnMenu?: boolean;
|
||||
/** Enables menu to choose which columns to display and group by.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showColumnMenu?: boolean;
|
||||
|
||||
/** Enables display of the filterbox in the column menu.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showFilter?: boolean;
|
||||
/** Enables display of the filterbox in the column menu.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showFilter?: boolean;
|
||||
|
||||
/** Show the dropzone for drag and drop grouping */
|
||||
showGroupPanel?: boolean;
|
||||
/** Show the dropzone for drag and drop grouping */
|
||||
showGroupPanel?: boolean;
|
||||
|
||||
/** Define a sortInfo object to specify a default sorting state.
|
||||
You can also observe this variable to utilize server-side sorting (see useExternalSorting).
|
||||
Syntax is sortinfo: { fields: ['fieldName1',' fieldName2'], direction: 'ASC'/'asc' || 'desc'/'DESC'}*/
|
||||
sortInfo?: any;
|
||||
/** Define a sortInfo object to specify a default sorting state.
|
||||
You can also observe this variable to utilize server-side sorting (see useExternalSorting).
|
||||
Syntax is sortinfo: { fields: ['fieldName1',' fieldName2'], direction: 'ASC'/'asc' || 'desc'/'DESC'}*/
|
||||
sortInfo?: SortInfo | KnockoutObservable<SortInfo>;
|
||||
|
||||
/** Set the tab index of the Vieport. */
|
||||
tabIndex?: number;
|
||||
/** Set the tab index of the Vieport. */
|
||||
tabIndex?: number;
|
||||
|
||||
/** Prevents the internal sorting from executing.
|
||||
The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/
|
||||
useExternalSorting?: boolean;
|
||||
}
|
||||
/** Prevents the internal sorting from executing.
|
||||
The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/
|
||||
useExternalSorting?: boolean;
|
||||
}
|
||||
|
||||
interface ColumnDef {
|
||||
/** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */
|
||||
field: string;
|
||||
type Direction = "asc" | "desc";
|
||||
|
||||
/** Sets the pretty display name of the column. default is the field given */
|
||||
displayName?: string;
|
||||
interface SortInfo {
|
||||
/** Which column to sort */
|
||||
column: SortColumn;
|
||||
|
||||
/** Sets the width of the column. Can be a fixed width in pixels as an int (42), string px('42px'), percentage string ('42%'), weighted asterisks (width divided by total number of *'s is all column definition widths) See github wiki for more details. */
|
||||
width?: string;
|
||||
}
|
||||
/** Which direction to sort */
|
||||
direction: Direction;
|
||||
}
|
||||
|
||||
interface SortColumn {
|
||||
/** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */
|
||||
field: string;
|
||||
|
||||
interface FilterOptions {
|
||||
filterText?: string;
|
||||
useExternalFilter?: boolean;
|
||||
}
|
||||
/** Sets the sort function for the column. Useful when you have data that is formatted in an unusal way or if you want to sort on an underlying data type. Example: function(a,b){return a > b} */
|
||||
sortingAlgorithm?: ((a:any, b:any) => number);
|
||||
}
|
||||
|
||||
interface PagingOptions {
|
||||
/** pageSizes: list of available page sizes. */
|
||||
pageSizes?: number[];
|
||||
/** pageSize: currently selected page size. */
|
||||
pageSize?: number;
|
||||
/** totalServerItems: Total items are on the server. */
|
||||
totalServerItems?: number;
|
||||
/** currentPage: the uhm... current page. */
|
||||
currentPage?: number;
|
||||
}
|
||||
interface ColumnDef {
|
||||
/** Appends a css class for the column cells */
|
||||
cellClass?:string;
|
||||
|
||||
/**
|
||||
* A function which takes the value of the cell and returns the display value. Useful when your data model has an underlying value which you need to convert to a human readable format.
|
||||
* @param val
|
||||
* @returns the display value
|
||||
* @example function(unixTimeTicks) { return new Date(unixTimeTicks); }
|
||||
*/
|
||||
cellFormatter?(val:any): string;
|
||||
|
||||
/**Sets the cell template for the column. See github wiki for more details.*/
|
||||
cellTemplate?: string | JQueryGenericPromise<string>;
|
||||
|
||||
/** Sets the pretty display name of the column. default is the field given */
|
||||
displayName?: string;
|
||||
|
||||
/** The string name of the property in your data model you want that column to represent. Can also be a property path on your data model. 'foo.bar.myField', 'Name.First', etc.. */
|
||||
field: string;
|
||||
|
||||
/** Sets the template for the column header cell. See github wiki for more details. */
|
||||
headerCellTemplate?: string | JQueryGenericPromise<string>;
|
||||
|
||||
/** Appends a css class for the column header. */
|
||||
headerClass?: string;
|
||||
|
||||
/**Sets the maximum width of the column.*/
|
||||
maxWidth?: number;
|
||||
|
||||
/**Whether or not column is resizable. */
|
||||
resizable?: boolean;
|
||||
|
||||
/**Whether or not column is sortable. */
|
||||
sortable?: boolean;
|
||||
|
||||
/** Sets the sort function for the column. Useful when you have data that is formatted in an unusal way or if you want to sort on an underlying data type. Example: function(a,b){return a > b} */
|
||||
sortFn?: ((a: any, b: any) => number);
|
||||
|
||||
/** Sets the width of the column. Can be a fixed width in pixels as an int (42), string px('42px'), percentage string ('42%'), weighted asterisks (width divided by total number of *'s is all column definition widths) See github wiki for more details. */
|
||||
width?: string;
|
||||
}
|
||||
|
||||
interface FilterOptions {
|
||||
/** Variable to contain the current search filter */
|
||||
filterText?: KnockoutObservable<string>;
|
||||
|
||||
/** Is the filtering internal or does it require a server visit. You should subscribe to filterText to refresh */
|
||||
useExternalFilter?: boolean;
|
||||
|
||||
/** Number of seconds to throttle before reapplying search */
|
||||
filterThrottle?: number;
|
||||
}
|
||||
|
||||
interface PagingOptions {
|
||||
/** pageSizes: list of available page sizes. */
|
||||
pageSizes?: KnockoutObservableArray<number>;
|
||||
|
||||
/** pageSize: currently selected page size. */
|
||||
pageSize?: KnockoutObservable<number>;
|
||||
|
||||
/** totalServerItems: Total items are on the server. */
|
||||
totalServerItems?: KnockoutObservable<number>;
|
||||
|
||||
/** currentPage: the uhm... current page. */
|
||||
currentPage?: KnockoutObservable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
interface IKg {
|
||||
domUtilityService: kg.DomUtilityService;
|
||||
|
||||
/** Default grid template */
|
||||
defaultGridTemplate():string;
|
||||
|
||||
/** Default row template. Can be overriden in GridOptions.rowTemplate */
|
||||
defaultRowTemplate(): string;
|
||||
|
||||
/** Default cell template. Can be overriden in GridOptions.cellTemplate */
|
||||
defaultCellTemplate(): string;
|
||||
|
||||
/** Default aggregate template */
|
||||
aggregateTemplate(): string;
|
||||
|
||||
/** Default headerrow template. Can be overriden in GridOptions.headerRowTemplate */
|
||||
defaultHeaderRowTemplate(): string;
|
||||
|
||||
/** Default headercell template. Can be overriden in GridOptions.headerCellTemplate */
|
||||
defaultHeaderCellTemplate():string;
|
||||
}
|
||||
|
||||
declare var kg: IKg;
|
||||
@@ -199,4 +277,3 @@ declare var kg: IKg;
|
||||
declare module "kg" {
|
||||
export = kg;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ app.use((ctx, next) => {
|
||||
const end: any = new Date();
|
||||
const ms = end - start;
|
||||
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
|
||||
ctx.assert(true, 404, 'Yep!');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -38,7 +38,7 @@ declare module "koa" {
|
||||
toJSON(): any;
|
||||
inspect(): any;
|
||||
throw(code?: any, message?: any): void;
|
||||
assert(): void;
|
||||
assert(test: any, status: number, message: string): void;
|
||||
}
|
||||
|
||||
export interface Request {
|
||||
|
||||
+21
-4
@@ -51,9 +51,10 @@ declare namespace L {
|
||||
|
||||
/*
|
||||
* The maximum radius that a cluster will cover from the central marker (in pixels). Default 80.
|
||||
* Decreasing will make more, smaller clusters.
|
||||
* Decreasing will make more, smaller clusters. You can also use a function that accepts
|
||||
* the current map zoom and returns the maximum cluster radius in pixels
|
||||
*/
|
||||
maxClusterRadius?: number;
|
||||
maxClusterRadius?: number | ((zoom: number) => number);
|
||||
|
||||
/*
|
||||
* Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster.
|
||||
@@ -82,11 +83,21 @@ declare namespace L {
|
||||
* Function used to create the cluster icon
|
||||
*/
|
||||
iconCreateFunction?: any;
|
||||
|
||||
/*
|
||||
* Boolean to split the addLayers processing in to small intervals so that the page does not freeze.
|
||||
*/
|
||||
chunkedLoading?: boolean;
|
||||
|
||||
/*
|
||||
* Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms.
|
||||
*/
|
||||
chunkDelay?: number;
|
||||
}
|
||||
|
||||
export class MarkerClusterGroup extends FeatureGroup<ILayer> {
|
||||
initialize(): void;
|
||||
initialize(options: MarkerClusterGroupOptions): void;
|
||||
constructor();
|
||||
constructor(options: MarkerClusterGroupOptions);
|
||||
|
||||
/*
|
||||
* Bulk methods for adding and removing markers and should be favoured over the
|
||||
@@ -121,5 +132,11 @@ declare namespace L {
|
||||
* Returns the array of total markers contained within that cluster.
|
||||
*/
|
||||
getAllChildMarkers(): Marker[];
|
||||
|
||||
/*
|
||||
* Zooms to show the given marker (spiderfying if required),
|
||||
* calls the callback when the marker is visible on the map.
|
||||
*/
|
||||
zoomToShowLayer(layer: any, callback: () => void): void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+36
-21
@@ -1,11 +1,14 @@
|
||||
// Type definitions for Leaflet.js 0.7.3
|
||||
// Type definitions for Leaflet.js 1.0.0
|
||||
// Project: https://github.com/Leaflet/Leaflet
|
||||
// Definitions by: Vladimir Zotov <https://github.com/rgripper>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path='../geojson/geojson.d.ts' />
|
||||
|
||||
declare namespace L {
|
||||
type LatLngExpression = LatLng | number[] | ({ lat: number; lng: number })
|
||||
type LatLngBoundsExpression = LatLngBounds | LatLngExpression[];
|
||||
type PositionString = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
|
||||
}
|
||||
|
||||
declare namespace L {
|
||||
@@ -16,7 +19,7 @@ declare namespace L {
|
||||
* The position of the control (one of the map corners). See control positions.
|
||||
* Default value: 'bottomright'.
|
||||
*/
|
||||
position?: string;
|
||||
position?: PositionString;
|
||||
|
||||
/**
|
||||
* The HTML text shown before the attributions. Pass false to disable.
|
||||
@@ -219,7 +222,7 @@ declare namespace L {
|
||||
/**
|
||||
* Returns a GeoJSON representation of the circle (GeoJSON Point Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.Feature<GeoJSON.Point>;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -254,11 +257,6 @@ declare namespace L {
|
||||
* Sets the radius of a circle marker. Units are in pixels.
|
||||
*/
|
||||
setRadius(radius: number): CircleMarker;
|
||||
|
||||
/**
|
||||
* Returns a GeoJSON representation of the circle marker (GeoJSON Point Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,12 +341,12 @@ declare namespace L {
|
||||
/**
|
||||
* Sets the position of the control. See control positions.
|
||||
*/
|
||||
setPosition(position: string): Control;
|
||||
setPosition(position: PositionString): Control;
|
||||
|
||||
/**
|
||||
* Returns the current position of the control.
|
||||
*/
|
||||
getPosition(): string;
|
||||
getPosition(): PositionString;
|
||||
|
||||
/**
|
||||
* Adds the control to the map.
|
||||
@@ -400,7 +398,7 @@ declare namespace L {
|
||||
*
|
||||
* Default value: 'topright'.
|
||||
*/
|
||||
position?: string; // 'topleft' | 'topright' | 'bottomleft' | 'bottomright'
|
||||
position?: PositionString;
|
||||
|
||||
/**
|
||||
* The text set on the zoom in button.
|
||||
@@ -550,7 +548,7 @@ declare namespace L {
|
||||
* positions.
|
||||
* Default value: 'topright'.
|
||||
*/
|
||||
position?: string;
|
||||
position?: PositionString;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1709,8 +1707,9 @@ declare namespace L {
|
||||
|
||||
/**
|
||||
* Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
|
||||
* Note: Descendent classes MultiPolygon & MultiPolyLine return `Feature`s, not `FeatureCollection`s
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.FeatureCollection<GeoJSON.GeometryObject>|GeoJSON.Feature<GeoJSON.MultiLineString|GeoJSON.MultiPolygon>;
|
||||
|
||||
////////////
|
||||
////////////
|
||||
@@ -1739,7 +1738,7 @@ declare namespace L {
|
||||
*
|
||||
* Default value: 'topright'.
|
||||
*/
|
||||
position?: string;
|
||||
position?: PositionString;
|
||||
|
||||
/**
|
||||
* If true, the control will be collapsed into an icon and expanded on mouse hover
|
||||
@@ -2000,7 +1999,7 @@ declare namespace L {
|
||||
export function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
|
||||
|
||||
/**
|
||||
* Clips the segment a to b by rectangular bounds. Used by Leaflet to only show
|
||||
* Clips the segment a to b by rectangular bounds. Used by Leaflet to only show
|
||||
* polyline points that are on the screen or near, increasing performance. Returns
|
||||
* either false or a length-2 array of clipped points.
|
||||
*/
|
||||
@@ -2734,6 +2733,22 @@ declare namespace L.Map {
|
||||
* If true, it will delay moveend event so that it doesn't happen many times in a row.
|
||||
*/
|
||||
debounceMoveend?: boolean;
|
||||
|
||||
/**
|
||||
* Duration of animated panning, in seconds.
|
||||
*/
|
||||
duration?: number;
|
||||
|
||||
/**
|
||||
* The curvature factor of panning animation easing (third parameter of the Cubic Bezier curve).
|
||||
* 1.0 means linear animation, the less the more bowed the curve.
|
||||
*/
|
||||
easeLinearity?: number;
|
||||
|
||||
/**
|
||||
* If true, panning won't fire movestart event on start (used internally for panning inertia).
|
||||
*/
|
||||
noMoveStart?: boolean;
|
||||
}
|
||||
|
||||
export interface FitBoundsOptions extends ZoomPanOptions {
|
||||
@@ -2921,7 +2936,7 @@ declare namespace L {
|
||||
/**
|
||||
* Returns a GeoJSON representation of the marker (GeoJSON Point Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.Feature<GeoJSON.Point>;
|
||||
|
||||
/**
|
||||
* Marker dragging handler (by both mouse and touch).
|
||||
@@ -3081,7 +3096,7 @@ declare namespace L {
|
||||
/**
|
||||
* Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.Feature<GeoJSON.MultiPolygon>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3122,7 +3137,7 @@ declare namespace L {
|
||||
/**
|
||||
* Returns a GeoJSON representation of the multipolyline (GeoJSON MultiLineString Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.Feature<GeoJSON.MultiLineString>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3384,7 +3399,7 @@ declare namespace L {
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* Sets the radius of a circle marker.
|
||||
* Sets the radius of a circle marker.
|
||||
*/
|
||||
radius?: number;
|
||||
|
||||
@@ -3543,7 +3558,7 @@ declare namespace L {
|
||||
/**
|
||||
* Returns a GeoJSON representation of the polyline (GeoJSON LineString Feature).
|
||||
*/
|
||||
toGeoJSON(): any;
|
||||
toGeoJSON(): GeoJSON.Feature<GeoJSON.LineString>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3858,7 +3873,7 @@ declare namespace L {
|
||||
* The position of the control (one of the map corners). See control positions.
|
||||
* Default value: 'bottomleft'.
|
||||
*/
|
||||
position?: string;
|
||||
position?: PositionString;
|
||||
|
||||
/**
|
||||
* Maximum width of the control in pixels. The width is set dynamically to show
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ describe("Linq.js tests", function () {
|
||||
it("Grouping Methods", function () {
|
||||
expect(Enumerable.From(["a","aa","aaa","a","a","aaa"])
|
||||
.GroupBy((item:string) => item.length)
|
||||
.Select((g: linq.Grouping<string>) => { return { key: g.Key(), count: g.Count() }; })
|
||||
.Select((g: linq.Grouping<number, string>) => { return { key: g.Key(), count: g.Count() }; })
|
||||
.OrderBy(g => g.key)
|
||||
.Select(g => g.key+":"+g.count)
|
||||
.ToString(",")).toBe("1:3,2:1,3:2");
|
||||
|
||||
Vendored
+21
-19
@@ -49,8 +49,10 @@ declare namespace linq {
|
||||
Scan(seed: any, func: string, resultSelector?: string): Enumerable<any>;
|
||||
Select<TResult>(selector: ($: T, i: number) => TResult): Enumerable<TResult>;
|
||||
Select(selector: string): Enumerable<any>;
|
||||
SelectMany(collectionSelector: ($: any, i: number) => any[], resultSelector?: ($: any, item: any) => any): Enumerable<any>;
|
||||
SelectMany(collectionSelector: ($: any, i: number) => Enumerable<any>, resultSelector?: ($: any, item: any) => any): Enumerable<any>;
|
||||
SelectMany<TResult>(collectionSelector: ($: T, i: number) => TResult[]): Enumerable<TResult>;
|
||||
SelectMany<TResult>(collectionSelector: ($: T, i: number) => Enumerable<TResult>): Enumerable<TResult>;
|
||||
SelectMany<TCollectionItem, TResult>(collectionSelector: ($: T, i: number) => TCollectionItem[], resultSelector: ($: T, item: TCollectionItem) => TResult): Enumerable<TResult>;
|
||||
SelectMany<TCollectionItem, TResult>(collectionSelector: ($: T, i: number) => Enumerable<TCollectionItem>, resultSelector: ($: T, item: TCollectionItem) => TResult): Enumerable<TResult>;
|
||||
SelectMany(collectionSelector: string, resultSelector?: string): Enumerable<any>;
|
||||
Where(predicate: ($ : T, i: number) => boolean): Enumerable<T>;
|
||||
Where(predicate: string): Enumerable<any>;
|
||||
@@ -170,12 +172,12 @@ declare namespace linq {
|
||||
LastIndexOf(item: T): number;
|
||||
// Convert Methods
|
||||
ToArray(): T[];
|
||||
ToLookup(keySelector: ($: T) => any, elementSelector?: ($: T) => any, compareSelector?: (key: any) => any): Lookup<T>;
|
||||
ToLookup(keySelector: string, elementSelector?: string, compareSelector?: string): Lookup<T>;
|
||||
ToLookup<TKey, TValue>(keySelector: ($: T) => TKey, elementSelector?: ($: T) => TValue, compareSelector?: (key: TKey) => any): Lookup<TKey, TValue>;
|
||||
ToLookup(keySelector: string, elementSelector?: string, compareSelector?: string): Lookup<any, any>;
|
||||
ToObject(keySelector: ($: T) => string, elementSelector: ($: T) => any): any;
|
||||
ToObject(keySelector: string, elementSelector: string): any;
|
||||
ToDictionary(keySelector: ($: T) => any, elementSelector: ($: T) => any, compareSelector?: (key: T) => any): Dictionary<T>;
|
||||
ToDictionary(keySelector: string, elementSelector: string, compareSelector?: string): Dictionary<T>;
|
||||
ToDictionary<TKey, TValue>(keySelector: ($: T) => TKey, elementSelector: ($: T) => TValue, compareSelector?: (key: TKey) => any): Dictionary<TKey, TValue>;
|
||||
ToDictionary(keySelector: string, elementSelector: string, compareSelector?: string): Dictionary<any, any>;
|
||||
ToJSON(replacer?: (key: any, value: any) => any, space?: number): string;
|
||||
ToJSON(replacer?: string, space?: number): string;
|
||||
ToString(separator?: string, selector?: ($: T) =>any): string;
|
||||
@@ -211,26 +213,26 @@ declare namespace linq {
|
||||
ThenByDescending(keySelector: string): OrderedEnumerable<T>;
|
||||
}
|
||||
|
||||
interface Grouping<T> extends Enumerable<T> {
|
||||
Key(): any;
|
||||
interface Grouping<TKey, T> extends Enumerable<T> {
|
||||
Key(): TKey;
|
||||
}
|
||||
|
||||
interface Lookup<TValue> {
|
||||
interface Lookup<TKey, TValue> {
|
||||
Count(): number;
|
||||
Get(key: any): Enumerable<TValue>;
|
||||
Contains(key: any): boolean;
|
||||
ToEnumerable(): Enumerable<TValue>;
|
||||
Get(key: TKey): Enumerable<TValue>;
|
||||
Contains(key: TKey): boolean;
|
||||
ToEnumerable(): Enumerable<Grouping<TKey, TValue>>;
|
||||
}
|
||||
|
||||
interface Dictionary<TValue> {
|
||||
Add(key: any, value: TValue): void;
|
||||
Get(key: any): any;
|
||||
Set(key: any, value: TValue): boolean;
|
||||
Contains(key: any): boolean;
|
||||
interface Dictionary<TKey, TValue> {
|
||||
Add(key: TKey, value: TValue): void;
|
||||
Get(key: TKey): TValue;
|
||||
Set(key: TKey, value: TValue): boolean;
|
||||
Contains(key: TKey): boolean;
|
||||
Clear(): void;
|
||||
Remove(key: any): void;
|
||||
Remove(key: TKey): void;
|
||||
Count(): number;
|
||||
ToEnumerable(): Enumerable<TValue>;
|
||||
ToEnumerable(): Enumerable<KeyValuePair<TKey, TValue>>;
|
||||
}
|
||||
|
||||
interface KeyValuePair<TKey, TValue> {
|
||||
|
||||
Vendored
+47
@@ -7732,6 +7732,53 @@ declare module _ {
|
||||
thisArg?: any): TResult;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
accumulator: TResult,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
inject<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
accumulator: TResult,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
inject<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
foldl<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
accumulator: TResult,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
foldl<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
thisArg?: any): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.reduceRight
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Vendored
+15
@@ -8547,6 +8547,21 @@ declare module _ {
|
||||
callback: MemoIterator<TValue, TResult>): TResult;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>,
|
||||
accumulator: TResult): LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TValue, TResult>(
|
||||
callback: MemoIterator<TValue, TResult>): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.reduceRight
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,8 @@ class SimpleTest {
|
||||
|
||||
this.element.mCustomScrollbar({
|
||||
scrollButtons: {
|
||||
enable: true
|
||||
enable: true,
|
||||
scrollAmount: 2
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -22,38 +23,78 @@ class SimpleTestAllParams {
|
||||
this.element = $(".content");
|
||||
|
||||
this.element.mCustomScrollbar({
|
||||
setWidth: false,
|
||||
setHeight: false,
|
||||
setWidth: 22,
|
||||
setHeight: "40%",
|
||||
setTop: 0,
|
||||
setLeft: 22,
|
||||
axis: "y",
|
||||
scrollbarPosition: "inside",
|
||||
scrollInertia: 950,
|
||||
mouseWheel: true,
|
||||
mouseWheelPixels: "auto",
|
||||
autoDraggerLength: true,
|
||||
autoHideScrollbar: false,
|
||||
autoExpandScrollbar: false,
|
||||
alwaysShowScrollbar: 0,
|
||||
snapAmount: [3,3],
|
||||
snapOffset: 3,
|
||||
mouseWheel: {
|
||||
enable: true,
|
||||
scrollAmount: 1,
|
||||
axis:"x",
|
||||
preventDefault: false,
|
||||
deltaFactor:12,
|
||||
normalizeDelta:true,
|
||||
invert: false,
|
||||
disableOver: ["select","option"]
|
||||
|
||||
},
|
||||
scrollButtons: {
|
||||
enable: false,
|
||||
scrollType: "continuous",
|
||||
scrollSpeed: "auto",
|
||||
scrollAmount: 40
|
||||
scrollType: "stepped",
|
||||
scrollAmount: 40,
|
||||
tabindex: 33,
|
||||
},
|
||||
keyboard:{
|
||||
enable: true,
|
||||
scrollAmount:5,
|
||||
scrollType:"stepless"
|
||||
},
|
||||
advanced: {
|
||||
updateOnBrowserResize: true,
|
||||
updateOnContentResize: false,
|
||||
updateOnImageLoad: true,
|
||||
updateOnSelectorChange: "ul li",
|
||||
extraDraggableSelectors: ".myClass",
|
||||
releaseDraggableSelectors: ".myClass",
|
||||
autoUpdateTimeout:60,
|
||||
autoExpandHorizontalScroll: false,
|
||||
autoScrollOnFocus: true,
|
||||
normalizeMouseWheelDelta: false
|
||||
autoScrollOnFocus: "input",
|
||||
},
|
||||
contentTouchScroll: true,
|
||||
documentTouchScroll: false,
|
||||
|
||||
callbacks: {
|
||||
onCreate: () => { },
|
||||
onInit: () => { },
|
||||
onScrollStart: () => { },
|
||||
onScroll: () => { },
|
||||
onTotalScroll: () => { },
|
||||
onTotalScrollBack: () => { },
|
||||
onTotalScrollOffset: 0,
|
||||
onTotalScrollBackOffset: 0,
|
||||
whileScrolling: () => { }
|
||||
whileScrolling: () => { },
|
||||
alwaysTriggerOffsets: false,
|
||||
onOverflowY: () => { },
|
||||
onOverflowX: () => { },
|
||||
onOverflowYNone: () => {},
|
||||
onOverflowXNone: () => {},
|
||||
onBeforeUpdate: () => {},
|
||||
onUpdate: () => {},
|
||||
onImageLoad: () => {},
|
||||
onSelectorChange: () => {},
|
||||
},
|
||||
theme: "light"
|
||||
theme: "light",
|
||||
live: true,
|
||||
liveSelector: ".myClass"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+168
-22
@@ -10,16 +10,35 @@ declare namespace MCustomScrollbar {
|
||||
/**
|
||||
* Set the width of your content (overwrites CSS width), value in pixels (integer) or percentage (string)
|
||||
*/
|
||||
setWidth?: any;
|
||||
setWidth?: boolean|number|string;
|
||||
/**
|
||||
* Set the height of your content (overwirtes CSS height), value in pixels (integer) or percentage (string)
|
||||
*/
|
||||
setHeight?: any;
|
||||
setHeight?: boolean|number|string;
|
||||
/**
|
||||
* Set the initial css top property of content, accepts string values (css top position).
|
||||
* Example: setTop: "-100px".
|
||||
*/
|
||||
setTop? : number|string;
|
||||
/**
|
||||
* Set the initial css top property of content, accepts string values (css top position).
|
||||
* Example: setTop: "-100px".
|
||||
*/
|
||||
setLeft? : number|string;
|
||||
/**
|
||||
* Define content’s scrolling axis (the type of scrollbars added to the element: vertical and/of horizontal).
|
||||
* Available values: "y", "x", "yx". y -vertical, x - horizontal
|
||||
* Available values: "y", "x", "yx". y -vertical, x - horizontal, yx - vertical and horizontal
|
||||
*/
|
||||
axis?: string;
|
||||
axis?: "x"|"y"|"yx";
|
||||
/**
|
||||
* Set the position of scrollbar in relation to content.
|
||||
* Available values: "inside", "outside".
|
||||
* Setting scrollbarPosition: "inside" (default) makes scrollbar appear inside the element.
|
||||
* Setting scrollbarPosition: "outside" makes scrollbar appear outside the element.
|
||||
* Note that setting the value to "outside" requires your element (or parent elements)
|
||||
* to have CSS position: relative (otherwise the scrollbar will be positioned in relation to document’s root element).
|
||||
*/
|
||||
scrollbarPosition?: "inside"|"outside";
|
||||
/**
|
||||
* Always keep scrollbar(s) visible, even when there’s nothing to scroll.
|
||||
* 0 – disable (default)
|
||||
@@ -28,6 +47,18 @@ declare namespace MCustomScrollbar {
|
||||
*/
|
||||
alwaysShowScrollbar?: number;
|
||||
/**
|
||||
* Make scrolling snap to a multiple of a fixed number of pixels. Useful in cases like scrolling tabular data,
|
||||
* image thumbnails or slides and you need to prevent scrolling from stopping half-way your elements.
|
||||
* Note that your elements must be of equal width or height in order for this to work properly.
|
||||
* To set different values for vertical and horizontal scrolling, use an array: [y,x]
|
||||
*/
|
||||
snapAmount?: number|[number,number];
|
||||
/**
|
||||
* Set an offset (in pixels) for the snapAmount option. Useful when for example you need to offset the
|
||||
* snap amount of table rows by the table header.
|
||||
*/
|
||||
snapOffset?: number;
|
||||
/**
|
||||
* Enable or disable auto-expanding the scrollbar when cursor is over or dragging the scrollbar.
|
||||
*/
|
||||
autoExpandScrollbar?: boolean;
|
||||
@@ -47,7 +78,7 @@ declare namespace MCustomScrollbar {
|
||||
* Set the mouse-wheel scrolling amount (in pixels).
|
||||
* The default value "auto" adjusts scrolling amount according to scrollable content length.
|
||||
*/
|
||||
scrollAmount?: number;
|
||||
scrollAmount?: "auto"|number;
|
||||
/**
|
||||
* Define the mouse-wheel scrolling axis when both vertical and horizontal scrollbars are present.
|
||||
* Set axis: "y" (default) for vertical or axis: "x" for horizontal scrolling.
|
||||
@@ -76,7 +107,27 @@ declare namespace MCustomScrollbar {
|
||||
* Set the tags that disable mouse-wheel when cursor is over them.
|
||||
* Default value: ["select","option","keygen","datalist","textarea"]
|
||||
*/
|
||||
disableOver?: string[]
|
||||
disableOver?: string[];
|
||||
}
|
||||
/**
|
||||
* Keyboard support
|
||||
*/
|
||||
keyboard?:{
|
||||
/**
|
||||
* Enable or disable content scrolling via keyboard.
|
||||
*/
|
||||
enable?: boolean;
|
||||
/**
|
||||
* Set the keyboard arrows scrolling amount (in pixels).
|
||||
* The default value "auto" adjusts scrolling amount according to scrollable content length.
|
||||
*/
|
||||
scrollAmount?: "auto"|number;
|
||||
/**
|
||||
* Define the buttons scrolling type/behavior.
|
||||
* scrollType: "stepless" – continuously scroll content while pressing the button (default)
|
||||
* scrollType: "stepped" – each button click scrolls content by a certain amount (defined in scrollAmount option above)
|
||||
*/
|
||||
scrollType?: "stepless"|"stepped";
|
||||
}
|
||||
/**
|
||||
* Mouse wheel scrolling pixels amount, value in pixels (integer) or "auto" (script calculates and sets pixels amount according to content length)
|
||||
@@ -96,19 +147,21 @@ declare namespace MCustomScrollbar {
|
||||
*/
|
||||
enable?: boolean;
|
||||
/**
|
||||
* Scroll buttons scroll type, values: "continuous" (scroll continuously while pressing the button), "pixels" (scrolls by a fixed number of pixels on each click")
|
||||
* Define the buttons scrolling type/behavior.
|
||||
* scrollType: "stepless" – continuously scroll content while pressing the button (default)
|
||||
* scrollType: "stepped" – each button click scrolls content by a certain amount (defined in scrollAmount option above)
|
||||
*/
|
||||
scrollType?: string;
|
||||
scrollType?: "stepless"|"stepped";
|
||||
/**
|
||||
* Scroll buttons continuous scrolling speed, integer value or "auto" (script calculates and sets the speed according to content length)
|
||||
* Set a tabindex value for the buttons.
|
||||
*/
|
||||
scrollSpeed?: number | string;
|
||||
tabindex?: number;
|
||||
/**
|
||||
* Scroll buttons pixels scrolling amount, value in pixels or "auto"
|
||||
*/
|
||||
scrollAmount?: number | string;
|
||||
scrollAmount?: "auto"|number ;
|
||||
}
|
||||
advanced?: {
|
||||
advanced?: {
|
||||
/**
|
||||
* Update scrollbars on browser resize (for fluid content blocks and layouts based on percentages), values: true, false. Set to false only when you content has fixed dimensions
|
||||
*/
|
||||
@@ -119,27 +172,75 @@ declare namespace MCustomScrollbar {
|
||||
*/
|
||||
updateOnContentResize?: boolean;
|
||||
/**
|
||||
* Update scrollbar(s) automatically each time an image inside the element is fully loaded.
|
||||
* Default value is auto which triggers the function only on "x" and "yx" axis (if needed).
|
||||
* The value should be true when your content contains images and you need the function to trigger on any axis.
|
||||
*/
|
||||
updateOnImageLoad?: "auto"|boolean;
|
||||
/**
|
||||
* Add extra selector(s) that’ll release scrollbar dragging upon mouseup, pointerup, touchend etc.
|
||||
* Example: extraDraggableSelectors: ".myClass, #myID"
|
||||
*/
|
||||
extraDraggableSelectors?: string;
|
||||
/**
|
||||
* Add extra selector(s) that’ll allow scrollbar dragging upon mousemove/up, pointermove/up, touchend etc.
|
||||
* Example: releaseDraggableSelectors: ".myClass, #myID"
|
||||
*/
|
||||
releaseDraggableSelectors?: string;
|
||||
/**
|
||||
* Set the auto-update timeout in milliseconds.
|
||||
* Default timeout: 60
|
||||
*/
|
||||
autoUpdateTimeout?: number;
|
||||
/**
|
||||
* Update scrollbar(s) automatically when the amount and size of specific selectors changes.
|
||||
* Useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size.
|
||||
* For example, setting updateOnSelectorChange: "ul li" will update scrollbars each time list-items inside the element are changed.
|
||||
* Setting the value to true, will update scrollbars each time any element is changed.
|
||||
* To disable (default) set to false.
|
||||
*/
|
||||
updateOnSelectorChange?: string|boolean;
|
||||
/**
|
||||
* Auto-expanding content's width on horizontal scrollbars, values: true, false. Set to true if you have horizontal scrollbr on content that change on-the-fly. Demo contains
|
||||
* blocks with images and horizontal scrollbars that use this option parameter
|
||||
*/
|
||||
autoExpandHorizontalScroll?: boolean;
|
||||
/**
|
||||
* Auto-scrolling on elements that have focus (e.g. scrollbar automatically scrolls to form text fields when the TAB key is pressed), values: true, false
|
||||
* Set the list of elements/selectors that will auto-scroll content to their position when focused.
|
||||
* For example, when pressing TAB key to focus input fields, if the field is out of the viewable area the content
|
||||
* will scroll to its top/left position (same bahavior with browser’s native scrollbar).
|
||||
* To completely disable this functionality, set autoScrollOnFocus: false.
|
||||
* Default:
|
||||
* "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']"
|
||||
*/
|
||||
autoScrollOnFocus?: boolean;
|
||||
autoScrollOnFocus?: boolean|string;
|
||||
/**
|
||||
* Normalize mouse wheel delta (-1/1), values: true, false
|
||||
*/
|
||||
normalizeMouseWheelDelta?: boolean;
|
||||
}
|
||||
/**
|
||||
* Additional scrolling method by touch-swipe content (for touch enabled devices), value: true, false
|
||||
*/
|
||||
contentTouchScroll?: boolean;
|
||||
/**
|
||||
* Enable or disable content touch-swipe scrolling for touch-enabled devices.
|
||||
* To completely disable, set contentTouchScroll: false.
|
||||
* Integer values define the axis-specific minimum amount required for scrolling momentum (default: 25).
|
||||
*/
|
||||
contentTouchScroll?: boolean|number;
|
||||
/**
|
||||
* Enable or disable document touch-swipe scrolling for touch-enabled devices.
|
||||
*/
|
||||
documentTouchScroll?: boolean;
|
||||
/**
|
||||
* All of the following callbacks option have examples in the callback demo - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/callbacks_example.html
|
||||
*/
|
||||
callbacks?: {
|
||||
/**
|
||||
* A function to call when plugin markup is created.
|
||||
*/
|
||||
onCreate?: () => void;
|
||||
/**
|
||||
* A function to call when scrollbars have initialized
|
||||
*/
|
||||
onInit?: () => void;
|
||||
/**
|
||||
* User defined callback function, triggered on scroll start event. You can call your own function(s) each time a scroll event begins
|
||||
*/
|
||||
@@ -176,11 +277,56 @@ declare namespace MCustomScrollbar {
|
||||
* Set alwaysTriggerOffsets: false when you need to trigger onTotalScroll and onTotalScrollBack callbacks once, each time scroll end or beginning is reached.
|
||||
*/
|
||||
alwaysTriggerOffsets?: boolean;
|
||||
/**
|
||||
* A function to call when content becomes long enough and vertical scrollbar is added.
|
||||
*/
|
||||
onOverflowY?: () => void;
|
||||
/**
|
||||
* A function to call when content becomes wide enough and horizontal scrollbar is added.
|
||||
*/
|
||||
onOverflowX?: () => void;
|
||||
/**
|
||||
* A function to call when content becomes short enough and vertical scrollbar is removed.
|
||||
*/
|
||||
onOverflowYNone?: () => void;
|
||||
/**
|
||||
* A function to call when content becomes narrow enough and horizontal scrollbar is removed.
|
||||
*/
|
||||
onOverflowXNone?: () => void;
|
||||
/**
|
||||
* A function to call right before scrollbar(s) are updated.
|
||||
*/
|
||||
onBeforeUpdate?: () => void;
|
||||
/**
|
||||
* A function to call when scrollbar(s) are updated.
|
||||
*/
|
||||
onUpdate?: () => void;
|
||||
/**
|
||||
* A function to call each time an image inside the element is fully loaded and scrollbar(s) are updated.
|
||||
*/
|
||||
onImageLoad?: () => void;
|
||||
/**
|
||||
* A function to call each time a type of element is added, removed or changes its size and scrollbar(s) are updated.
|
||||
*/
|
||||
onSelectorChange?: () => void;
|
||||
}
|
||||
/**
|
||||
* Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html
|
||||
*/
|
||||
theme?: string;
|
||||
/**
|
||||
* Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html
|
||||
*/
|
||||
theme?: string;
|
||||
/**
|
||||
* Enable or disable applying scrollbar(s) on all elements matching the current selector, now and in the future.
|
||||
* Set live: true when you need to add scrollbar(s) on elements that do not yet exist in the page.
|
||||
* These could be elements added by other scripts or plugins after some action by the user takes place (e.g. lightbox markup may not exist untill the user clicks a link).
|
||||
* If you need at any time to disable or enable the live option, set live: "off" and "on" respectively.
|
||||
* You can also tell the script to disable live option after the first invocation by setting live: "once".
|
||||
*/
|
||||
live?: string|boolean;
|
||||
/**
|
||||
* Set the matching set of elements (instead of the current selector) to add scrollbar(s), now and in the future.
|
||||
*/
|
||||
liveSelector?: string;
|
||||
|
||||
}
|
||||
|
||||
interface ScrollToParameterOptions {
|
||||
|
||||
Vendored
+1
@@ -641,6 +641,7 @@ declare namespace __MaterialUI {
|
||||
touchRippleColor?: string;
|
||||
touchRippleOpacity?: number;
|
||||
type?: string;
|
||||
containerElement?: React.ReactNode | string;
|
||||
}
|
||||
|
||||
interface EnhancedButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps<EnhancedButton> {
|
||||
|
||||
Vendored
+3
@@ -49,6 +49,9 @@ declare namespace MDNS {
|
||||
interface Browser extends NodeJS.EventEmitter {
|
||||
start():any;
|
||||
stop():any;
|
||||
on(event:string, listener:Function):this;
|
||||
on(event:'serviceUp', listener:(info:Service)=>void):this;
|
||||
on(event:'serviceDown', listener:(info:Service)=>void):this;
|
||||
}
|
||||
|
||||
interface BrowserStatic {
|
||||
|
||||
+10
-1
@@ -1,4 +1,13 @@
|
||||
# Meteor Type Definitions
|
||||
# Meteor Type Definitions [DEPRECATED]
|
||||
|
||||
## Deprecated
|
||||
|
||||
These definitions for Meteor are now deprecated. They should still work for versions of Meteor up to 1.2.1.
|
||||
|
||||
The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to view the definitions directly, or contribute to them, they can be found here: <https://github.com/meteor-typings/meteor>.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
These are the definitions for version 1.3 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/).
|
||||
|
||||
|
||||
@@ -650,16 +650,16 @@ Accounts.emailTemplates.siteName = "AwesomeSite";
|
||||
Accounts.emailTemplates.from = "AwesomeSite Admin <accounts@example.com>";
|
||||
Accounts.emailTemplates.headers = { asdf: 'asdf', qwer: 'qwer' };
|
||||
|
||||
Accounts.emailTemplates.enrollAccount.subject = function (user) {
|
||||
Accounts.emailTemplates.enrollAccount.subject = function (user: Meteor.User) {
|
||||
return "Welcome to Awesome Town, " + user.profile.name;
|
||||
};
|
||||
Accounts.emailTemplates.enrollAccount.html = function (user, url) {
|
||||
Accounts.emailTemplates.enrollAccount.html = function (user: Meteor.User, url: string) {
|
||||
return "<h1>Some html here</h1>";
|
||||
};
|
||||
Accounts.emailTemplates.enrollAccount.from = function() {
|
||||
return "asdf@asdf.com";
|
||||
};
|
||||
Accounts.emailTemplates.enrollAccount.text = function (user, url) {
|
||||
Accounts.emailTemplates.enrollAccount.text = function (user: Meteor.User, url: string) {
|
||||
return "You have been selected to participate in building a better future!"
|
||||
+ " To activate your account, simply click the link below:\n\n"
|
||||
+ url;
|
||||
|
||||
@@ -66,6 +66,21 @@ function test_test() {
|
||||
});
|
||||
}
|
||||
|
||||
function test_specify() {
|
||||
|
||||
specify('does something', () => { });
|
||||
|
||||
specify('does something', (done) => { done(); });
|
||||
|
||||
specify.only('does something', () => { });
|
||||
|
||||
specify.skip('does something', () => { });
|
||||
|
||||
specify('does something', function () {
|
||||
this.timeout(2000);
|
||||
});
|
||||
}
|
||||
|
||||
function test_before() {
|
||||
before(() => { });
|
||||
|
||||
|
||||
Vendored
+1
@@ -44,6 +44,7 @@ declare var it: Mocha.ITestDefinition;
|
||||
declare var xit: Mocha.ITestDefinition;
|
||||
// alias for `it`
|
||||
declare var test: Mocha.ITestDefinition;
|
||||
declare var specify: Mocha.ITestDefinition;
|
||||
|
||||
declare function before(action: () => void): void;
|
||||
|
||||
|
||||
Vendored
+1
@@ -1399,6 +1399,7 @@ declare module "fs" {
|
||||
|
||||
export interface ReadStream extends stream.Readable {
|
||||
close(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
export interface WriteStream extends stream.Writable {
|
||||
close(): void;
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
/// <reference path="nw.js.d.ts" />
|
||||
/*
|
||||
* nw.App Tests
|
||||
*/
|
||||
var argv = nw.App.argv;
|
||||
var fullArgv = nw.App.fullArgv;
|
||||
var filteredArgv = nw.App.filteredArgv;
|
||||
var dataPath = nw.App.dataPath;
|
||||
var manifest = nw.App.manifest;
|
||||
|
||||
nw.App.clearCache();
|
||||
nw.App.closeAllWindows();
|
||||
nw.App.crashBrowser();
|
||||
nw.App.crashRenderer();
|
||||
nw.App.getProxyForURL( 'https://github.com/alirdn' );
|
||||
nw.App.setProxyConfig( 'http=foopy:80;ftp=foopy2' );
|
||||
nw.App.quit();
|
||||
nw.App.addOriginAccessWhitelistEntry( 'http://github.com/', 'chrome-extension', location.host, true );
|
||||
nw.App.removeOriginAccessWhitelistEntry( 'http://github.com/', 'chrome-extension', location.host, true );
|
||||
|
||||
/*
|
||||
* Note:
|
||||
* nw.App.registerGlobalHotKey() tested in Shortcut Tests
|
||||
* nw.App.unregisterGlobalHotKey() tested in Shortcut Tests
|
||||
* */
|
||||
|
||||
nw.App.on( 'open', function ( args ) {
|
||||
console.log( args );
|
||||
});
|
||||
|
||||
nw.App.on( 'reopen', function () {
|
||||
console.log( 'reopened' );
|
||||
});
|
||||
|
||||
/**
|
||||
* nw.Clipboard Tests
|
||||
*/
|
||||
// get the system clipboard
|
||||
var clipboard = nw.Clipboard.get();
|
||||
// Read from clipboard
|
||||
var text = clipboard.get( 'text' );
|
||||
console.log( text );
|
||||
|
||||
// Or write something
|
||||
clipboard.set( 'I love NW.js :)', 'text' );
|
||||
|
||||
// And clear it!
|
||||
clipboard.clear();
|
||||
|
||||
/**
|
||||
* nw.Menu Tests
|
||||
*/
|
||||
// Create an empty context menu
|
||||
var menu = new nw.Menu();
|
||||
|
||||
// Add some items
|
||||
menu.append( new nw.MenuItem( { label: 'Item A' }) );
|
||||
menu.append( new nw.MenuItem( { label: 'Item B' }) );
|
||||
menu.append( new nw.MenuItem( { type: 'separator' }) );
|
||||
menu.append( new nw.MenuItem( { label: 'Item C' }) );
|
||||
|
||||
// Remove one item
|
||||
menu.removeAt( 1 );
|
||||
|
||||
// Popup as context menu
|
||||
menu.popup( 10, 10 );
|
||||
|
||||
// Iterate menu's items
|
||||
for ( var i = 0; i < menu.items.length; ++i ) {
|
||||
console.log( menu.items[i] );
|
||||
}
|
||||
// Create an empty menubar
|
||||
var menu = new nw.Menu( { type: 'menubar' });
|
||||
|
||||
// Create a submenu as the 2nd level menu
|
||||
var submenu = new nw.Menu();
|
||||
submenu.append( new nw.MenuItem( { label: 'Item A' }) );
|
||||
submenu.append( new nw.MenuItem( { label: 'Item B' }) );
|
||||
|
||||
// Create and append the 1st level menu to the menubar
|
||||
menu.append( new nw.MenuItem( {
|
||||
label: 'First Menu',
|
||||
submenu: submenu
|
||||
}) );
|
||||
|
||||
// Assign it to `window.menu` to get the menu displayed
|
||||
nw.Window.get().menu = menu;
|
||||
|
||||
/**
|
||||
* nw.MenuItem Tests
|
||||
*/
|
||||
var item: any;
|
||||
|
||||
// Create a separator
|
||||
item = new nw.MenuItem( { type: 'separator' });
|
||||
|
||||
// Create a normal item with label and icon
|
||||
item = new nw.MenuItem( {
|
||||
type: "normal",
|
||||
label: "I'm a menu item",
|
||||
icon: "img/icon.png"
|
||||
});
|
||||
|
||||
// Or you can omit the 'type' field for normal items
|
||||
item = new nw.MenuItem( { label: 'Simple item' });
|
||||
|
||||
// Bind a callback to item
|
||||
item = new nw.MenuItem( {
|
||||
label: "Click me",
|
||||
click: function () {
|
||||
console.log( "I'm clicked" );
|
||||
},
|
||||
key: "s",
|
||||
modifiers: "ctrl+alt",
|
||||
});
|
||||
|
||||
// You can have submenu!
|
||||
var submenu = new nw.Menu();
|
||||
submenu.append( new nw.MenuItem( { label: 'Item 1' }) );
|
||||
submenu.append( new nw.MenuItem( { label: 'Item 2' }) );
|
||||
submenu.append( new nw.MenuItem( { label: 'Item 3' }) );
|
||||
item.submenu = submenu;
|
||||
|
||||
// And everything can be changed at runtime
|
||||
item.label = 'New label';
|
||||
item.click = function () {
|
||||
console.log( 'New click callback' );
|
||||
};
|
||||
|
||||
/**
|
||||
* nw.Screen Tests
|
||||
*/
|
||||
//init must be called once during startup, before any function to nw.Screen can be called
|
||||
nw.Screen.Init();
|
||||
|
||||
var screenCB = {
|
||||
onDisplayBoundsChanged: function ( screen: any ) {
|
||||
console.log( 'displayBoundsChanged', screen );
|
||||
},
|
||||
|
||||
onDisplayAdded: function ( screen: any ) {
|
||||
console.log( 'displayAdded', screen );
|
||||
},
|
||||
|
||||
onDisplayRemoved: function ( screen: any ) {
|
||||
console.log( 'displayRemoved', screen )
|
||||
}
|
||||
};
|
||||
|
||||
// listen to screen events
|
||||
nw.Screen.on( 'displayBoundsChanged', screenCB.onDisplayBoundsChanged );
|
||||
nw.Screen.on( 'displayAdded', screenCB.onDisplayAdded );
|
||||
nw.Screen.on( 'displayRemoved', screenCB.onDisplayRemoved );
|
||||
|
||||
/**
|
||||
* nw.Screen.chooseDesktopMedia() Tests
|
||||
*/
|
||||
nw.Screen.Init(); // you only need to call this once
|
||||
nw.Screen.chooseDesktopMedia( ["window", "screen"],
|
||||
function ( streamId ) {
|
||||
var vid_constraint = {
|
||||
mandatory: {
|
||||
chromeMediaSource: 'desktop',
|
||||
chromeMediaSourceId: streamId,
|
||||
maxWidth: 1920,
|
||||
maxHeight: 1080
|
||||
},
|
||||
optional: <any[]>[]
|
||||
};
|
||||
//navigator.webkitGetUserMedia( { audio: false, video: constraint }, success_func, fallback_func );
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* nw.Screen.DesktopCaptureMonitor Tests
|
||||
*/
|
||||
var dcm = nw.Screen.DesktopCaptureMonitor;
|
||||
nw.Screen.Init();
|
||||
dcm.on( "added", function ( id, name, order, type ) {
|
||||
//select first stream and shutdown
|
||||
var constraints = {
|
||||
audio: {
|
||||
mandatory: {
|
||||
chromeMediaSource: "system",
|
||||
chromeMediaSourceId: dcm.registerStream( id )
|
||||
}
|
||||
},
|
||||
video: {
|
||||
mandatory: {
|
||||
chromeMediaSource: 'desktop',
|
||||
chromeMediaSourceId: dcm.registerStream( id )
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: call getUserMedia with contraints
|
||||
|
||||
dcm.stop();
|
||||
});
|
||||
|
||||
dcm.on( "removed", function ( id ) {
|
||||
});
|
||||
dcm.on( "orderchanged", function ( id, new_order, old_order ) {
|
||||
});
|
||||
dcm.on( "namechanged", function ( id, name ) {
|
||||
});
|
||||
dcm.on( "thumbnailchanged", function ( id, thumbnail ) {
|
||||
});
|
||||
dcm.start( true, true );
|
||||
|
||||
/**
|
||||
* nw.Shell Tests
|
||||
*/
|
||||
// Open URL with default browser.
|
||||
nw.Shell.openExternal( 'https://github.com/nwjs/nw.js' );
|
||||
|
||||
// Open a text file with default text editor.
|
||||
nw.Shell.openItem( 'test.txt' );
|
||||
|
||||
// Show a file in parent folder with file manager.
|
||||
nw.Shell.showItemInFolder( 'test.txt' );
|
||||
|
||||
/**
|
||||
* nw.Shortcut Tests
|
||||
*/
|
||||
var option = {
|
||||
key: "Ctrl+Shift+A",
|
||||
active: function () {
|
||||
console.log( "Global desktop keyboard shortcut: " + this.key + " active." );
|
||||
},
|
||||
failed: function ( msg: any ) {
|
||||
// :(, fail to register the |key| or couldn't parse the |key|.
|
||||
console.log( msg );
|
||||
}
|
||||
};
|
||||
|
||||
// Create a shortcut with |option|.
|
||||
var shortcut = new nw.Shortcut( option );
|
||||
|
||||
// Register global desktop shortcut, which can work without focus.
|
||||
nw.App.registerGlobalHotKey( shortcut );
|
||||
|
||||
// If register |shortcut| successfully and user struck "Ctrl+Shift+A", |shortcut|
|
||||
// will get an "active" event.
|
||||
|
||||
// You can also add listener to shortcut's active and failed event.
|
||||
shortcut.on( 'active', function () {
|
||||
console.log( "Global desktop keyboard shortcut: " + this.key + " active." );
|
||||
});
|
||||
|
||||
shortcut.on( 'failed', function ( msg: any ) {
|
||||
console.log( msg );
|
||||
});
|
||||
|
||||
// Unregister the global desktop shortcut.
|
||||
nw.App.unregisterGlobalHotKey( shortcut );
|
||||
|
||||
/**
|
||||
* nw.Tray Tests
|
||||
*/
|
||||
// Create a tray icon
|
||||
var tray = new nw.Tray( { title: 'Tray', icon: 'img/icon.png' });
|
||||
|
||||
// Give it a menu
|
||||
var menu = new nw.Menu();
|
||||
menu.append( new nw.MenuItem( { type: 'checkbox', label: 'box1' }) );
|
||||
tray.menu = menu;
|
||||
|
||||
// Remove the tray
|
||||
tray.remove();
|
||||
tray = null;
|
||||
|
||||
/**
|
||||
* nw.Window Tests
|
||||
*/
|
||||
// Get the current window
|
||||
var win = nw.Window.get();
|
||||
|
||||
// Listen to the minimize event
|
||||
win.on( 'minimize', function () {
|
||||
console.log( 'Window is minimized' );
|
||||
});
|
||||
|
||||
// Minimize the window
|
||||
win.minimize();
|
||||
|
||||
// Unlisten the minimize event
|
||||
win.removeAllListeners( 'minimize' );
|
||||
|
||||
// Create a new window and get it
|
||||
nw.Window.open( 'https://github.com', {}, function ( new_win ) {
|
||||
// And listen to new window's focus event
|
||||
new_win.on( 'focus', function () {
|
||||
console.log( 'New window is focused' );
|
||||
});
|
||||
});
|
||||
|
||||
// Get the current window
|
||||
var win = nw.Window.get();
|
||||
|
||||
// Create a new window and get it
|
||||
nw.Window.open( 'https://github.com/nwjs/nw.js', {}, function ( new_win ) {
|
||||
// do something with the newly created window
|
||||
});
|
||||
|
||||
win.on( 'close', function () {
|
||||
this.hide(); // Pretend to be closed already
|
||||
console.log( "We're closing..." );
|
||||
this.close( true ); // then close it forcely
|
||||
});
|
||||
|
||||
win.close();
|
||||
|
||||
// png as base64string
|
||||
win.capturePage( function ( base64string ) {
|
||||
// do something with the base64string
|
||||
}, { format: 'png', datatype: 'raw' });
|
||||
|
||||
// png as node buffer
|
||||
win.capturePage( function ( buffer ) {
|
||||
// do something with the buffer
|
||||
}, { format: 'png', datatype: 'buffer' });
|
||||
|
||||
// Open a new window.
|
||||
nw.Window.open( 'popup.html', {}, function ( win ) {
|
||||
|
||||
// Release the 'win' object here after the new window is closed.
|
||||
win.on( 'closed', function () {
|
||||
win = null;
|
||||
});
|
||||
|
||||
// Listen to main window's close event
|
||||
nw.Window.get().on( 'close', function () {
|
||||
// Hide the window to give user the feeling of closing immediately
|
||||
this.hide();
|
||||
|
||||
// If the new window is still open then close it.
|
||||
if ( win != null )
|
||||
win.close( true );
|
||||
|
||||
// After closing the new window, close the main window.
|
||||
this.close( true );
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
nw.Window.get().on( 'new-win-policy', function ( frame, url, policy ) {
|
||||
// do not open the window
|
||||
policy.ignore();
|
||||
// and open it in external browser
|
||||
nw.Shell.openExternal( url );
|
||||
});
|
||||
Vendored
+1883
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
/// <reference path="./opentype.d.ts" />
|
||||
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var fontSize = 72;
|
||||
var ctx: CanvasRenderingContext2D;
|
||||
|
||||
opentype.load('fonts/Roboto-Black.ttf', function(err, font) {
|
||||
if (err) {
|
||||
alert('Font could not be loaded: ' + err);
|
||||
} else {
|
||||
var path = font.getPath('Hello, World!', 0, 150, 72);
|
||||
// If you just want to draw the text you can also use font.draw(ctx, text, x, y, fontSize).
|
||||
path.draw(ctx);
|
||||
}
|
||||
});
|
||||
|
||||
var myBuffer: ArrayBuffer;
|
||||
var font = opentype.parse(myBuffer);
|
||||
font = opentype.loadSync('fonts/Roboto-Black.ttf');
|
||||
|
||||
var notdefGlyph = new opentype.Glyph({
|
||||
name: '.notdef',
|
||||
unicode: 0,
|
||||
advanceWidth: 650,
|
||||
path: new opentype.Path()
|
||||
});
|
||||
|
||||
var aPath = new opentype.Path();
|
||||
aPath.moveTo(100, 0);
|
||||
aPath.lineTo(100, 700);
|
||||
// more drawing instructions...
|
||||
var aGlyph = new opentype.Glyph({
|
||||
name: 'A',
|
||||
unicode: 65,
|
||||
advanceWidth: 650,
|
||||
path: aPath
|
||||
});
|
||||
|
||||
var glyphs = [notdefGlyph, aGlyph];
|
||||
var font = new opentype.Font({
|
||||
familyName: 'OpenTypeSans',
|
||||
styleName: 'Medium',
|
||||
unitsPerEm: 1000,
|
||||
ascender: 800,
|
||||
descender: -200,
|
||||
glyphs: glyphs});
|
||||
font.download();
|
||||
|
||||
font.getPath('text', x, y, fontSize);
|
||||
font.draw(ctx, 'text', x, y, fontSize);
|
||||
font.drawPoints(ctx, 'text', x, y, fontSize);
|
||||
font.drawMetrics(ctx, 'text', x, y, fontSize);
|
||||
font.stringToGlyphs('string');
|
||||
font.charToGlyph('c');
|
||||
font.getKerningValue(notdefGlyph, aGlyph);
|
||||
|
||||
aGlyph.getPath(x, y, fontSize);
|
||||
aGlyph.draw(ctx, x, y, fontSize);
|
||||
aGlyph.drawPoints(ctx, x, y, fontSize);
|
||||
aGlyph.drawMetrics(ctx, x, y, fontSize);
|
||||
|
||||
aPath.draw(ctx);
|
||||
aPath.toPathData(7);
|
||||
aPath.toSVG(7);
|
||||
Vendored
+248
@@ -0,0 +1,248 @@
|
||||
// Type definitions for opentype.js
|
||||
// Project: https://github.com/nodebox/opentype.js
|
||||
// Definitions by: Dan Marshall <https://github.com/danmarshall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace opentypejs {
|
||||
|
||||
interface Contour extends Array<Point> {
|
||||
}
|
||||
|
||||
class Encoding {
|
||||
charset: string;
|
||||
charToGlyphIndex(c: string): number;
|
||||
font: Font;
|
||||
}
|
||||
|
||||
interface Field {
|
||||
name: string;
|
||||
type: string;
|
||||
value: any;
|
||||
}
|
||||
|
||||
class Font {
|
||||
private nametoGlyphIndex;
|
||||
private supported;
|
||||
constructor(options: FontOptions);
|
||||
ascender: number;
|
||||
cffEncoding: Encoding;
|
||||
charToGlyph(c: string): Glyph;
|
||||
charToGlyphIndex(s: string): number;
|
||||
descender: number;
|
||||
download(): void;
|
||||
draw(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, fontSize: number, options?: RenderOptions): void;
|
||||
drawMetrics(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, fontSize: number, options?: RenderOptions): void;
|
||||
drawPoints(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, fontSize: number, options?: RenderOptions): void;
|
||||
encoding: Encoding;
|
||||
forEachGlyph(text: string, x: number, y: number, fontSize: number, options: RenderOptions, callback: { (glyph: Glyph, x: number, y: number, fontSize: number, options?: RenderOptions): void; }): void;
|
||||
getEnglishName(name: string): string;
|
||||
getGposKerningValue: { (leftGlyph: Glyph | number, rightGlyph: Glyph | number): number; };
|
||||
getKerningValue(leftGlyph: Glyph | number, rightGlyph: Glyph | number): number;
|
||||
getPath(text: string, x: number, y: number, fontSize: number, options?: RenderOptions): Path;
|
||||
getPaths(text: string, x: number, y: number, fontSize: number, options?: RenderOptions): Path[];
|
||||
glyphs: GlyphSet;
|
||||
glyphIndexToName(gid: number): string;
|
||||
glyphNames: GlyphNames;
|
||||
hasChar(c: string): boolean;
|
||||
kerningPairs: KerningPairs;
|
||||
names: FontNames;
|
||||
nameToGlyph(name: string): Glyph;
|
||||
nameToGlyphIndex(name: string): number;
|
||||
numberOfHMetrics: number;
|
||||
numGlyphs: number;
|
||||
outlinesFormat: string;
|
||||
stringToGlyphs(s: string): Glyph[];
|
||||
tables: { [tableName: string]: Table; };
|
||||
toArrayBuffer(): ArrayBuffer;
|
||||
toBuffer(): ArrayBuffer;
|
||||
toTables(): Table;
|
||||
unitsPerEm: number;
|
||||
validate(): void;
|
||||
}
|
||||
|
||||
interface FontNames {
|
||||
copyright: LocalizedName;
|
||||
description: LocalizedName;
|
||||
designer: LocalizedName;
|
||||
designerURL: LocalizedName;
|
||||
fontFamily: LocalizedName;
|
||||
fontSubfamily: LocalizedName;
|
||||
fullName: LocalizedName;
|
||||
license: LocalizedName;
|
||||
licenseURL: LocalizedName;
|
||||
manufacturer: LocalizedName;
|
||||
manufacturerURL: LocalizedName;
|
||||
postScriptName: LocalizedName;
|
||||
trademark: LocalizedName;
|
||||
version: LocalizedName;
|
||||
}
|
||||
|
||||
interface FontOptions {
|
||||
copyright?: string;
|
||||
ascender?: number;
|
||||
descender?: number;
|
||||
description?: string;
|
||||
designer?: string;
|
||||
designerURL?: string;
|
||||
empty?: boolean;
|
||||
familyName?: string;
|
||||
fullName?: string;
|
||||
glyphs?: Glyph[] | GlyphSet;
|
||||
license?: string;
|
||||
licenseURL?: string;
|
||||
manufacturer?: string;
|
||||
manufacturerURL?: string;
|
||||
postScriptName?: string;
|
||||
styleName?: string;
|
||||
unitsPerEm?: number;
|
||||
trademark?: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
class Glyph {
|
||||
private index;
|
||||
private xMin;
|
||||
private xMax;
|
||||
private yMin;
|
||||
private yMax;
|
||||
private points;
|
||||
constructor(options: GlyphOptions);
|
||||
addUnicode(unicode: number): void;
|
||||
advanceWidth: number;
|
||||
bindConstructorValues(options: GlyphOptions): void;
|
||||
draw(ctx: CanvasRenderingContext2D, x: number, y: number, fontSize: number): void;
|
||||
drawMetrics(ctx: CanvasRenderingContext2D, x: number, y: number, fontSize: number): void;
|
||||
drawPoints(ctx: CanvasRenderingContext2D, x: number, y: number, fontSize: number): void;
|
||||
getContours(): Contour[];
|
||||
getMetrics(): Metrics;
|
||||
getPath(x: number, y: number, fontSize: number): Path;
|
||||
name: string;
|
||||
path: Path | { (): Path; };
|
||||
unicode: number;
|
||||
unicodes: number[];
|
||||
}
|
||||
|
||||
interface GlyphOptions {
|
||||
advanceWidth?: number;
|
||||
index?: number;
|
||||
font?: Font;
|
||||
name?: string;
|
||||
path?: Path;
|
||||
unicode?: number;
|
||||
unicodes?: number[];
|
||||
xMax?: number;
|
||||
xMin?: number;
|
||||
yMax?: number;
|
||||
yMin?: number;
|
||||
}
|
||||
|
||||
class GlyphNames {
|
||||
private names;
|
||||
constructor(post: Post);
|
||||
glyphIndexToName(gid: number): string;
|
||||
nameToGlyphIndex(name: string): number;
|
||||
}
|
||||
|
||||
class GlyphSet {
|
||||
private font;
|
||||
private glyphs;
|
||||
constructor(font: Font, glyphs: Glyph[] | { (): Glyph; }[]);
|
||||
get(index: number): Glyph;
|
||||
length: number;
|
||||
push(index: number, loader: { (): Glyph; }): void;
|
||||
}
|
||||
|
||||
interface KerningPairs {
|
||||
[pair: string]: number;
|
||||
}
|
||||
|
||||
function load(url: string, callback: { (error: any, font?: Font): void; }): void;
|
||||
|
||||
function loadSync(url: string): Font;
|
||||
|
||||
interface LocalizedName {
|
||||
[lang: string]: string;
|
||||
}
|
||||
|
||||
interface Metrics {
|
||||
leftSideBearing: number;
|
||||
rightSideBearing?: number;
|
||||
xMax: number;
|
||||
xMin: number;
|
||||
yMax: number;
|
||||
yMin: number;
|
||||
}
|
||||
|
||||
function parse(buffer: any): Font;
|
||||
|
||||
class Path {
|
||||
private fill;
|
||||
private stroke;
|
||||
private strokeWidth;
|
||||
constructor();
|
||||
bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void;
|
||||
close: () => void;
|
||||
closePath(): void;
|
||||
commands: PathCommand[];
|
||||
curveTo: (x1: number, y1: number, x2: number, y2: number, x: number, y: number) => void;
|
||||
draw(ctx: CanvasRenderingContext2D): void;
|
||||
extend(pathOrCommands: Path | PathCommand[]): void;
|
||||
lineTo(x: number, y: number): void;
|
||||
moveTo(x: number, y: number): void;
|
||||
quadraticCurveTo(x1: number, y1: number, x: number, y: number): void;
|
||||
quadTo: (x1: number, y1: number, x: number, y: number) => void;
|
||||
toPathData(decimalPlaces: number): string;
|
||||
toSVG(decimalPlaces: number): string;
|
||||
unitsPerEm: number;
|
||||
}
|
||||
|
||||
interface PathCommand {
|
||||
type: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
x1?: number;
|
||||
y1?: number;
|
||||
x2?: number;
|
||||
y2?: number;
|
||||
}
|
||||
|
||||
interface Point {
|
||||
lastPointOfContour?: boolean;
|
||||
}
|
||||
|
||||
interface Post {
|
||||
glyphNameIndex?: number[];
|
||||
isFixedPitch: number;
|
||||
italicAngle: number;
|
||||
maxMemType1: number;
|
||||
minMemType1: number;
|
||||
maxMemType42: number;
|
||||
minMemType42: number;
|
||||
names?: string[];
|
||||
numberOfGlyphs?: number;
|
||||
offset?: number[];
|
||||
underlinePosition: number;
|
||||
underlineThickness: number;
|
||||
version: number;
|
||||
}
|
||||
|
||||
interface RenderOptions {
|
||||
kerning: boolean;
|
||||
}
|
||||
|
||||
interface Table {
|
||||
[propName: string]: any;
|
||||
encode(): number[];
|
||||
fields: Field[];
|
||||
sizeOf(): number;
|
||||
tables: Table[];
|
||||
tableName: string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare var opentype: typeof opentypejs;
|
||||
|
||||
declare module "opentype.js" {
|
||||
export = opentype;
|
||||
}
|
||||
@@ -18,10 +18,11 @@ passport.use(new google.OAuthStrategy({
|
||||
consumerSecret: process.env.GOOGLE_CONSUMER_SECRET,
|
||||
callbackURL: process.env.PASSPORT_GOOGLE_CALLBACK_URL
|
||||
},
|
||||
function(accessToken:string, refreshToken:string, profile:google.Profile, done:(error:any, user?:any) => void) {
|
||||
function(accessToken:string, refreshToken:string, profile:google.Profile, done:(error:any, user?:any, msg?: google.VerifyOptions) => void) {
|
||||
User.findOrCreate(profile.id, profile.provider, function(err, user) {
|
||||
if (err) { return done(err); }
|
||||
done(null, user);
|
||||
else if(!user) return done(null, false, {message: 'not found user'});
|
||||
return done(null, user);
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
+9
-1
@@ -28,9 +28,17 @@ declare module 'passport-google-oauth' {
|
||||
sessionKey?: string;
|
||||
}
|
||||
|
||||
interface VerifyOptions {
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface VerifyFunction {
|
||||
(error: any, user?: any, msg?: VerifyOptions): void;
|
||||
}
|
||||
|
||||
class OAuthStrategy implements passport.Strategy {
|
||||
constructor(options: IOAuthStrategyOption,
|
||||
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
verify: (accessToken: string, refreshToken: string, profile: Profile, done: VerifyFunction) => void);
|
||||
name: string;
|
||||
authenticate: (req: express.Request, options?: Object) => void;
|
||||
}
|
||||
|
||||
@@ -502,6 +502,33 @@ export class ReactBootstrapTest extends Component<any, any> {
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
<div style={style}>
|
||||
<Tab.Container id="left-tabs-example" defaultActiveKey="first">
|
||||
<Row className="clearfix">
|
||||
<Col sm={4}>
|
||||
<Nav bsStyle="pills" stacked>
|
||||
<NavItem eventKey="first">
|
||||
Tab 1
|
||||
</NavItem>
|
||||
<NavItem eventKey="second">
|
||||
Tab 2
|
||||
</NavItem>
|
||||
</Nav>
|
||||
</Col>
|
||||
<Col sm={8}>
|
||||
<Tab.Content animation>
|
||||
<Tab.Pane eventKey="first">
|
||||
Tab 1 content
|
||||
</Tab.Pane>
|
||||
<Tab.Pane eventKey="second">
|
||||
Tab 2 content
|
||||
</Tab.Pane>
|
||||
</Tab.Content>
|
||||
</Col>
|
||||
</Row>
|
||||
</Tab.Container>
|
||||
</div>
|
||||
|
||||
<div style={style}>
|
||||
<Pager>
|
||||
<PageItem href='#'>Previous</PageItem>
|
||||
|
||||
Vendored
+33
-2
@@ -435,8 +435,39 @@ declare module "react-bootstrap" {
|
||||
animation?: boolean;
|
||||
eventKey?: any; // TODO: Add more specific type
|
||||
}
|
||||
type Tab = React.ClassicComponent<TabProps, {}>;
|
||||
var Tab: React.ClassicComponentClass<TabProps>;
|
||||
interface TabClass extends React.ClassicComponentClass<TabProps> {
|
||||
Container: TabContainer;
|
||||
Pane: TabPane;
|
||||
Content: TabClass;
|
||||
}
|
||||
type Tab = TabClass;
|
||||
var Tab: TabClass;
|
||||
|
||||
// <Tab.Container />
|
||||
// ----------------------------------------
|
||||
interface TabContainerProps extends React.HTMLAttributes {
|
||||
activeKey?: any;
|
||||
defaultActiveKey?: any;
|
||||
generateChildId?: (eventKey: any, type: any) => string;
|
||||
}
|
||||
type TabContainer = React.ClassicComponentClass<TabContainerProps>;
|
||||
|
||||
// <Tab.Pane />
|
||||
// ----------------------------------------
|
||||
interface TabPaneProps extends React.HTMLAttributes {
|
||||
animation?: boolean | React.ComponentClass<any>;
|
||||
'aria-labelledby'?: string;
|
||||
bsClass?: string;
|
||||
eventKey?: any;
|
||||
onEnter?: Function;
|
||||
onEntered?: Function;
|
||||
onEntering?: Function;
|
||||
onExit?: Function;
|
||||
onExited?: Function;
|
||||
onExiting?: Function;
|
||||
unmountOnExit?: boolean;
|
||||
}
|
||||
type TabPane = React.ClassicComponentClass<TabPaneProps>;
|
||||
|
||||
// <Pager />
|
||||
// ----------------------------------------
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../react/react-dom.d.ts" />
|
||||
/// <reference path="./react-codemirror.d.ts" />
|
||||
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import * as Codemirror from "react-codemirror";
|
||||
|
||||
class CodemirrorTest extends React.Component<React.Props<{}>, {}> {
|
||||
private editorRef: ReactCodeMirror.ReactCodeMirror;
|
||||
|
||||
componentDidMount() {
|
||||
this.editorRef.focus();
|
||||
this.editorRef.getCodeMirror();
|
||||
}
|
||||
|
||||
render() {
|
||||
const options = {
|
||||
lineNumbers: true,
|
||||
readOnly: false,
|
||||
mode: "markdown"
|
||||
};
|
||||
const onChange = (value: any) => console.log(value);
|
||||
const onFocusChange = (focused: boolean) => console.log(focused);
|
||||
const onScroll = (scrollInfo: CodeMirror.ScrollInfo) => console.log(scrollInfo.top);
|
||||
const codeMirrorInstance = CodeMirror(document.body);
|
||||
|
||||
return <div>
|
||||
<Codemirror className="test-codemirror"
|
||||
codeMirrorInstance={codeMirrorInstance}
|
||||
onChange={onChange}
|
||||
onFocusChange={onFocusChange}
|
||||
onScroll={onScroll}
|
||||
options={options}
|
||||
path="editor"
|
||||
ref={(r: ReactCodeMirror.ReactCodeMirror) => this.editorRef = r}
|
||||
value="foo bar" />
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for React Codemirror v0.2.6
|
||||
// Project: https://github.com/JedWatson/react-codemirror
|
||||
// Definitions by: Vicky Lai <https://github.com/velveret>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts"/>
|
||||
/// <reference path="../codemirror/codemirror.d.ts"/>
|
||||
|
||||
declare namespace ReactCodeMirror {
|
||||
interface ReactCodeMirrorProps extends __React.Props<ReactCodeMirror> {
|
||||
onChange?: (newValue: string) => any; // called when a change is made
|
||||
onFocusChange?: (focused: boolean) => any; // called when the editor is focused or loses focus
|
||||
onScroll?: (scrollInfo: CodeMirror.ScrollInfo) => any; // called when the editor is scrolled
|
||||
options?: CodeMirror.EditorConfiguration; // options passed to the CodeMirror instance
|
||||
path?: string; // the identifying name for the textarea
|
||||
value?: string; // the editor value
|
||||
className?: string; // CSS className for the outer element
|
||||
codeMirrorInstance?: CodeMirror.Editor; // the CodeMirror instance
|
||||
}
|
||||
|
||||
interface ReactCodeMirror extends __React.Component<ReactCodeMirrorProps, {}> {
|
||||
/** Focuses the CodeMirror instance. */
|
||||
focus(): void;
|
||||
|
||||
/** Returns the CodeMirror instance, if available. */
|
||||
getCodeMirror(): CodeMirror.Editor;
|
||||
}
|
||||
|
||||
interface ReactCodeMirrorClass extends __React.ComponentClass<ReactCodeMirrorProps> { }
|
||||
}
|
||||
|
||||
declare module "react-codemirror" {
|
||||
const RCM: ReactCodeMirror.ReactCodeMirrorClass;
|
||||
export = RCM;
|
||||
}
|
||||
Vendored
+5
-3
@@ -9,21 +9,23 @@ declare namespace ReactHelmet {
|
||||
import React = __React;
|
||||
|
||||
interface HelmetProps {
|
||||
title?: string;
|
||||
titleTemplate?: string;
|
||||
base?: any;
|
||||
htmlAttributes?: any;
|
||||
link?: Array<any>;
|
||||
meta?: Array<any>;
|
||||
script?: Array<any>;
|
||||
title?: string;
|
||||
titleTemplate?: string;
|
||||
onChangeClientState?: (newState: any) => void;
|
||||
}
|
||||
|
||||
interface HelmetData {
|
||||
title: HelmetDatum;
|
||||
base: HelmetDatum;
|
||||
htmlAttributes: HelmetDatum;
|
||||
link: HelmetDatum;
|
||||
meta: HelmetDatum;
|
||||
script: HelmetDatum;
|
||||
title: HelmetDatum;
|
||||
}
|
||||
|
||||
interface HelmetDatum {
|
||||
|
||||
@@ -51,7 +51,13 @@ function testDimensions() {
|
||||
BackAndroid.addEventListener("hardwareBackPress", () => {
|
||||
});
|
||||
|
||||
var styles = StyleSheet.create(
|
||||
interface LocalStyles {
|
||||
container: React.ViewStyle;
|
||||
welcome: React.TextStyle;
|
||||
instructions: React.TextStyle;
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create<LocalStyles>(
|
||||
{
|
||||
container: {
|
||||
flex: 1,
|
||||
@@ -74,13 +80,18 @@ var styles = StyleSheet.create(
|
||||
|
||||
|
||||
class Welcome extends React.Component<any,any> {
|
||||
|
||||
|
||||
refs: {
|
||||
[key: string]: any
|
||||
rootView: View
|
||||
}
|
||||
|
||||
testNativeMethods() {
|
||||
this.setNativeProps({});
|
||||
// this.setNativeProps({});
|
||||
|
||||
const { rootView } = this.refs;
|
||||
|
||||
rootView.measure((x, y, width, height) => {
|
||||
rootView.measure((x: number, y: number, width: number, height: number) => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+23
-6
@@ -5522,7 +5522,7 @@ declare namespace __React {
|
||||
}
|
||||
|
||||
export interface NavigationHeaderProps {
|
||||
renderTitleComponent?(props: Object): JSX.element
|
||||
renderTitleComponent?(props: Object): JSX.Element
|
||||
}
|
||||
|
||||
export interface NavigationHeaderStatic extends React.ComponentClass<NavigationHeaderProps> {
|
||||
@@ -5535,7 +5535,7 @@ declare namespace __React {
|
||||
style?: ViewStyle
|
||||
navigationState?: any
|
||||
onNavigate(action: Object): boolean
|
||||
renderScene?(props): JSX.Element
|
||||
renderScene?(props: any /* undocumented on 0.27 */): JSX.Element
|
||||
}
|
||||
|
||||
export interface NavigationCardStackStatic extends React.ComponentClass<NavigationCardStackProps> {
|
||||
@@ -5547,6 +5547,26 @@ declare namespace __React {
|
||||
Header: NavigationHeaderStatic;
|
||||
Reducer: NavigationReducerStatic;
|
||||
}
|
||||
|
||||
export interface NavigationContainerProps {
|
||||
tabs: NavigationTab[];
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface NavigationContainerStatic extends React.ComponentClass<NavigationContainerProps> {
|
||||
create(inClass: any): any;
|
||||
}
|
||||
|
||||
export interface NavigationRootContainerProps extends React.Props<NavigationRootContainerStatic> {
|
||||
renderNavigation: NavigationRenderer;
|
||||
reducer: NavigationReducerStatic;
|
||||
persistenceKey?: string;
|
||||
}
|
||||
|
||||
export interface NavigationRootContainerStatic extends React.ComponentClass<NavigationRootContainerProps> {
|
||||
getBackAction(): NavigationAction;
|
||||
handleNavigation( action: NavigationAction ): boolean;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -5618,7 +5638,7 @@ declare namespace __React {
|
||||
export type StyleSheet = StyleSheetStatic
|
||||
|
||||
export var SwipeableListView: SwipeableListViewStatic
|
||||
export type SwipeableListView = SwipeableListViewStatci
|
||||
export type SwipeableListView = SwipeableListViewStatic
|
||||
|
||||
export var Switch: SwitchStatic
|
||||
export type Switch = SwitchStatic
|
||||
@@ -5741,9 +5761,6 @@ declare namespace __React {
|
||||
|
||||
export type NavigationReducer = NavigationReducerStatic;
|
||||
export var NavigationReducer: NavigationReducerStatic;
|
||||
|
||||
export type SwipeableListView = SwipeableListViewStatic;
|
||||
export var SwipeableListView: SwipeableListViewStatic;
|
||||
|
||||
export type Easing = EasingStatic;
|
||||
export var Easing: EasingStatic;
|
||||
|
||||
Vendored
+1
@@ -484,6 +484,7 @@ declare module "react-router" {
|
||||
export type RouterState = ReactRouter.RouterState
|
||||
export type HistoryBase = ReactRouter.HistoryBase
|
||||
export type RouterOnContext = ReactRouter.RouterOnContext
|
||||
export type RouteProps = ReactRouter.RouteProps
|
||||
|
||||
export {
|
||||
Router,
|
||||
|
||||
Vendored
+12
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for React v0.14 (react-addons-perf)
|
||||
// Type definitions for React v15.1.0 (react-addons-perf)
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -31,11 +31,18 @@ declare namespace __React {
|
||||
namespace Perf {
|
||||
export function start(): void;
|
||||
export function stop(): void;
|
||||
export function printInclusive(measurements: Measurements[]): void;
|
||||
export function printExclusive(measurements: Measurements[]): void;
|
||||
export function printWasted(measurements: Measurements[]): void;
|
||||
export function printDOM(measurements: Measurements[]): void;
|
||||
export function printInclusive(measurements?: Measurements[]): void;
|
||||
export function printExclusive(measurements?: Measurements[]): void;
|
||||
export function printWasted(measurements?: Measurements[]): void;
|
||||
export function printOperations(measurements?: Measurements[]): void;
|
||||
export function getLastMeasurements(): Measurements[];
|
||||
export function getExclusive(measurements?: Measurements[]): any;
|
||||
export function getInclusive(measurements?: Measurements[]): any;
|
||||
export function getWasted(measurements?: Measurements[]): any;
|
||||
export function getOperations(measurements?: Measurements[]): any;
|
||||
|
||||
// Renamed to printOperations(). Please use it instead.
|
||||
export function printDOM(measurements?: Measurements[]): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,7 +404,13 @@ var measurements = React.addons.Perf.getLastMeasurements();
|
||||
React.addons.Perf.printInclusive(measurements);
|
||||
React.addons.Perf.printExclusive(measurements);
|
||||
React.addons.Perf.printWasted(measurements);
|
||||
React.addons.Perf.printOperations(measurements);
|
||||
React.addons.Perf.printDOM(measurements);
|
||||
React.addons.Perf.printInclusive();
|
||||
React.addons.Perf.printExclusive();
|
||||
React.addons.Perf.printWasted();
|
||||
React.addons.Perf.printOperations();
|
||||
React.addons.Perf.printDOM();
|
||||
|
||||
//
|
||||
// PureRenderMixin addon
|
||||
|
||||
@@ -534,7 +534,24 @@ var measurements = Perf.getLastMeasurements();
|
||||
Perf.printInclusive(measurements);
|
||||
Perf.printExclusive(measurements);
|
||||
Perf.printWasted(measurements);
|
||||
Perf.printOperations(measurements);
|
||||
Perf.printInclusive();
|
||||
Perf.printExclusive();
|
||||
Perf.printWasted();
|
||||
Perf.printOperations();
|
||||
|
||||
console.log(Perf.getExclusive());
|
||||
console.log(Perf.getInclusive());
|
||||
console.log(Perf.getWasted());
|
||||
console.log(Perf.getOperations());
|
||||
console.log(Perf.getExclusive(measurements));
|
||||
console.log(Perf.getInclusive(measurements));
|
||||
console.log(Perf.getWasted(measurements));
|
||||
console.log(Perf.getOperations(measurements));
|
||||
|
||||
// Renamed to printOperations(). Please use it instead.
|
||||
Perf.printDOM(measurements);
|
||||
Perf.printDOM();
|
||||
|
||||
//
|
||||
// PureRenderMixin addon
|
||||
|
||||
Vendored
+2
@@ -364,6 +364,8 @@ declare module "redis" {
|
||||
script(key: string, callback?: ResCallbackT<any>): boolean;
|
||||
quit(args:any[], callback?:ResCallbackT<any>): boolean;
|
||||
quit(...args:any[]): boolean;
|
||||
sscan(...args:any[]): boolean;
|
||||
sscan(args:any[], callback?:ResCallbackT<any>): boolean;
|
||||
scan(...args:any[]): boolean;
|
||||
scan(args:any[], callback?:ResCallbackT<any>): boolean;
|
||||
hscan(...args:any[]): boolean;
|
||||
|
||||
+38
-92
@@ -1,103 +1,49 @@
|
||||
/// <reference path="./redlock.d.ts" />
|
||||
|
||||
import Redlock = require('redlock');
|
||||
import * as Redlock from 'redlock';
|
||||
import * as Promise from 'bluebird';
|
||||
import {RedisClient} from 'redis';
|
||||
|
||||
import NodeifyCallback = RedlockTypes.NodeifyCallback;
|
||||
import Lock = RedlockTypes.Lock;
|
||||
import RedlockOptions = RedlockTypes.RedlockOptions;
|
||||
import Lock = Redlock.Lock;
|
||||
|
||||
namespace RedlockTest {
|
||||
// constructor
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let client: any;
|
||||
let options: RedlockOptions;
|
||||
redlock = new Redlock([client]);
|
||||
redlock = new Redlock([client], options);
|
||||
}
|
||||
|
||||
let redlock: Redlock;
|
||||
let client: RedisClient;
|
||||
let lock: Lock;
|
||||
|
||||
redlock = new Redlock([client]);
|
||||
redlock = new Redlock([client], {
|
||||
driftFactor: 0.1,
|
||||
retryCount: 2,
|
||||
retryDelay: 3
|
||||
});
|
||||
|
||||
redlock.acquire('resource', 30).then((lock: Lock) => {});
|
||||
redlock.acquire('resource', 30, (err: any, lock: Lock) => {});
|
||||
redlock.lock('resource', 30).then((lock: Lock) => {});
|
||||
redlock.lock('resource', 30, (err: any, lock: Lock) => {});
|
||||
|
||||
// acquire, lock
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let resource: string;
|
||||
let ttl: number;
|
||||
let callback: NodeifyCallback<Lock>;
|
||||
let result: Promise<Lock>;
|
||||
result = redlock.acquire(resource, ttl);
|
||||
result = redlock.acquire(resource, ttl, callback);
|
||||
result = redlock.lock(resource, ttl);
|
||||
result = redlock.lock(resource, ttl, callback);
|
||||
}
|
||||
// There is currently no way to test the disposer as the bluebird typings does not
|
||||
// expose the .using method.
|
||||
// promise.using(redlock.disposer('resource', 30), (lock: Lock) => {});
|
||||
|
||||
redlock.release(lock);
|
||||
redlock.release(lock, (err: any) => {});
|
||||
redlock.unlock(lock);
|
||||
redlock.unlock(lock, (err: any) => {});
|
||||
|
||||
// disposer
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let resource: string;
|
||||
let ttl: number;
|
||||
let result: any;
|
||||
result = redlock.acquire(resource, ttl);
|
||||
}
|
||||
|
||||
// release, unlock
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let lock: Lock;
|
||||
let callback: NodeifyCallback<void>;
|
||||
let result: Promise<void>;
|
||||
result = redlock.release(lock);
|
||||
result = redlock.release(lock, callback);
|
||||
result = redlock.unlock(lock);
|
||||
result = redlock.unlock(lock, callback);
|
||||
}
|
||||
|
||||
// extend
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let lock: Lock;
|
||||
let ttl: number;
|
||||
let callback: NodeifyCallback<Lock>;
|
||||
let result: Promise<Lock>;
|
||||
result = redlock.extend(lock, ttl);
|
||||
result = redlock.extend(lock, ttl, callback);
|
||||
}
|
||||
|
||||
// _lock
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let resource: string;
|
||||
let value: string;
|
||||
let ttl: number;
|
||||
let callback: NodeifyCallback<Lock>;
|
||||
let result: Promise<Lock>;
|
||||
result = redlock._lock(resource, value, ttl);
|
||||
result = redlock._lock(resource, value, ttl, callback);
|
||||
}
|
||||
|
||||
// _random
|
||||
{
|
||||
let redlock: Redlock;
|
||||
let result: string;
|
||||
result = redlock._random();
|
||||
}
|
||||
redlock.extend(lock, 30).then((lock: Lock) => {});
|
||||
redlock.extend(lock, 30, (err: any, lock: Lock) => {});
|
||||
}
|
||||
|
||||
namespace LockTest {
|
||||
// unlock
|
||||
{
|
||||
let lock: Lock;
|
||||
let callback: NodeifyCallback<void>;
|
||||
let result: Promise<void>;
|
||||
result = lock.unlock();
|
||||
result = lock.unlock(callback);
|
||||
}
|
||||
|
||||
// extend
|
||||
{
|
||||
let lock: Lock;
|
||||
let ttl: number;
|
||||
let callback: NodeifyCallback<Lock>;
|
||||
let result: Promise<Lock>;
|
||||
result = lock.extend(ttl);
|
||||
result = lock.extend(ttl, callback);
|
||||
}
|
||||
|
||||
let lock: Lock;
|
||||
|
||||
lock.unlock();
|
||||
lock.unlock((err) => {});
|
||||
|
||||
lock.extend(30).then((lock: Lock) => {});
|
||||
lock.extend(30, (err: any, lock: Lock) => {});
|
||||
}
|
||||
|
||||
Vendored
+41
-39
@@ -4,59 +4,61 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path="../redis/redis.d.ts" />
|
||||
|
||||
declare namespace RedlockTypes {
|
||||
interface LockError extends Error {}
|
||||
|
||||
interface NodeifyCallback<T> {
|
||||
(err: any, value?: T): void;
|
||||
declare module "redlock" {
|
||||
|
||||
import * as redis from 'redis';
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
namespace Redlock {
|
||||
|
||||
interface Callback<T> {
|
||||
(err: any, value?: T): void;
|
||||
}
|
||||
|
||||
interface Lock {
|
||||
|
||||
redlock: Redlock;
|
||||
resource: string;
|
||||
value: any;
|
||||
expiration: number;
|
||||
|
||||
unlock(callback?: Callback<void>): Promise<void>;
|
||||
|
||||
extend(ttl: number, callback?: Callback<Lock>): Promise<Lock>;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
driftFactor?: number;
|
||||
retryCount?: number;
|
||||
retryDelay?: number;
|
||||
}
|
||||
|
||||
interface LockError extends Error {}
|
||||
}
|
||||
|
||||
interface Lock {
|
||||
redlock: Redlock;
|
||||
resource: string;
|
||||
value: any;
|
||||
expiration: number;
|
||||
|
||||
unlock(callback?: NodeifyCallback<void>): Promise<void>;
|
||||
|
||||
extend(ttl: number, callback?: NodeifyCallback<Lock>): Promise<Lock>;
|
||||
}
|
||||
|
||||
interface RedlockOptions {
|
||||
driftFactor?: number;
|
||||
retryCount?: number;
|
||||
retryDelay?: number;
|
||||
}
|
||||
|
||||
|
||||
class Redlock {
|
||||
LockError: LockError;
|
||||
|
||||
driftFactor: number;
|
||||
retryCount: number;
|
||||
retryDelay: number;
|
||||
|
||||
servers: any[]; // array of redis.RedisClient
|
||||
servers: redis.RedisClient[];
|
||||
|
||||
constructor(clients: any[], options?: RedlockOptions);
|
||||
constructor(clients: any[], options?: Redlock.Options);
|
||||
|
||||
acquire(resource: string, ttl: number, callback?: NodeifyCallback<Lock>): Promise<Lock>;
|
||||
lock(resource: string, ttl: number, callback?: NodeifyCallback<Lock>): Promise<Lock>;
|
||||
acquire(resource: string, ttl: number, callback?: Redlock.Callback<Redlock.Lock>): Promise<Redlock.Lock>;
|
||||
lock(resource: string, ttl: number, callback?: Redlock.Callback<Redlock.Lock>): Promise<Redlock.Lock>;
|
||||
|
||||
disposer(resource: string, ttl: number): any; // return bluebird.Disposer
|
||||
disposer(resource: string, ttl: number, errorHandler?: Redlock.Callback<void>): any; // bluebird Disposer
|
||||
|
||||
release(lock: Lock, callback?: NodeifyCallback<void>): Promise<void>;
|
||||
unlock(lock: Lock, callback?: NodeifyCallback<void>): Promise<void>;
|
||||
release(lock: Redlock.Lock, callback?: Redlock.Callback<void>): Promise<void>;
|
||||
unlock(lock: Redlock.Lock, callback?: Redlock.Callback<void>): Promise<void>;
|
||||
|
||||
extend(lock: Lock, ttl: number, callback?: NodeifyCallback<Lock>): Promise<Lock>;
|
||||
|
||||
_lock(resource: string, value: string, ttl: number, callback?: NodeifyCallback<Lock>): Promise<Lock>;
|
||||
|
||||
_random(): string;
|
||||
extend(lock: Redlock.Lock, ttl: number, callback?: Redlock.Callback<Redlock.Lock>): Promise<Redlock.Lock>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "redlock" {
|
||||
import Redlock = RedlockTypes.Redlock;
|
||||
|
||||
export = Redlock;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ let loggerSimpleOpts = createLogger({
|
||||
predicate: (getState, action) => true,
|
||||
stateTransformer: (state) => state,
|
||||
actionTransformer: (action) => action,
|
||||
errorTransformer: (error) => error
|
||||
errorTransformer: (error) => error,
|
||||
diff: true,
|
||||
diffPredicate: (getState, action) => true,
|
||||
});
|
||||
|
||||
let loggerCollapsedBool = createLogger({
|
||||
|
||||
Vendored
+2
@@ -40,6 +40,8 @@ declare module 'redux-logger' {
|
||||
stateTransformer?: (state: any) => any;
|
||||
actionTransformer?: (action: any) => any;
|
||||
errorTransformer?: (error: any) => any;
|
||||
diff?: boolean;
|
||||
diffPredicate?: LoggerPredicate;
|
||||
}
|
||||
|
||||
// Trickery to get TypeScript to accept that our anonymous, non-default export is a function.
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
import express = require('express');
|
||||
import requestIp = require('request-ip');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(requestIp.mw());
|
||||
|
||||
var ipMiddleware = function(req:express.Request, res:express.Response, next:Function) {
|
||||
var clientIp = requestIp.getClientIp(req);
|
||||
next();
|
||||
|
||||
Vendored
+6
@@ -28,5 +28,11 @@ declare module "request-ip" {
|
||||
};
|
||||
}
|
||||
|
||||
interface Options {
|
||||
attributeName: string;
|
||||
}
|
||||
|
||||
export function getClientIp(req:Request):string;
|
||||
|
||||
export function mw(options?: Options): (req: Request, res: any, next: any) => any;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/// <reference path="resolve.d.ts" />
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as resolve from 'resolve';
|
||||
|
||||
function test_basic_async() {
|
||||
resolve('typescript', function(error, resolved) {
|
||||
if (error) {
|
||||
console.error(error.message);
|
||||
return;
|
||||
}
|
||||
console.log(resolved);
|
||||
});
|
||||
}
|
||||
|
||||
function test_basic_sync() {
|
||||
var resolved = resolve.sync('typescript');
|
||||
console.log(resolved);
|
||||
}
|
||||
|
||||
function test_options_async() {
|
||||
resolve('typescript', {
|
||||
basedir: process.cwd(),
|
||||
package: {},
|
||||
extensions: ['.js'],
|
||||
packageFilter: function(pkg, pkgfile) {
|
||||
return pkg;
|
||||
},
|
||||
pathFilter: function(pkg, path, relativePath) {
|
||||
return path
|
||||
},
|
||||
paths: [process.cwd()],
|
||||
moduleDirectory: 'node_modules',
|
||||
readFile: fs.readFile,
|
||||
isFile: function(file, cb) {
|
||||
fs.stat(file, function(error, stat) {
|
||||
if (error && error.code === 'ENOENT') {
|
||||
return cb(null, false);
|
||||
} else if (error) {
|
||||
return cb(error);
|
||||
} else {
|
||||
return cb(null, stat.isFile());
|
||||
}
|
||||
});
|
||||
}
|
||||
}, function(error, resolved) {
|
||||
if (error) {
|
||||
console.error(error.message);
|
||||
return;
|
||||
}
|
||||
console.log(resolved);
|
||||
});
|
||||
}
|
||||
|
||||
function test_options_sync() {
|
||||
var resolved = resolve.sync('typescript', {
|
||||
basedir: process.cwd(),
|
||||
package: {},
|
||||
extensions: ['.js'],
|
||||
packageFilter: function(pkg, pkgfile) {
|
||||
return pkg;
|
||||
},
|
||||
pathFilter: function(pkg, path, relativePath) {
|
||||
return path
|
||||
},
|
||||
paths: [process.cwd()],
|
||||
moduleDirectory: 'node_modules',
|
||||
readFileSync: fs.readFileSync,
|
||||
isFile: function(file) {
|
||||
try {
|
||||
return fs.statSync(file).isFile();
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(resolved);
|
||||
}
|
||||
|
||||
function test_is_core() {
|
||||
var fsIsCore = resolve.isCore('fs');
|
||||
var typescriptIsCore = resolve.isCore('typescript');
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user