Merge pull request #7840 from AyaMorisawa/patch-20

Remove trailing whitespaces
This commit is contained in:
Masahiro Wakame
2016-01-29 13:38:24 +09:00
22 changed files with 209 additions and 210 deletions
+7 -7
View File
@@ -51,37 +51,37 @@ declare module "tabtab" {
* Holds interesting values to drive the output of the completion.
*/
interface Data {
/**
* full command being completed
*/
line: string;
/**
* number of words
*/
words: number;
/**
* cursor position
*/
point: number;
/**
* tabing in the middle of a word: foo bar baz bar foobarrrrrrr
*/
partial: string;
/**
* last word of the line
*/
last: string;
/**
* last partial of the line
*/
lastPartial: string;
/**
* the previous word
*/
+73 -73
View File
@@ -15,13 +15,13 @@ declare module 'tedious' {
*/
name: string;
}
export interface ColumnMetaData {
/**
* The column's name
*/
colName: string;
/**
* The column type.
*/
@@ -31,18 +31,18 @@ declare module 'tedious' {
* The precision. Only applicable to numeric and decimal.
*/
precision?: number;
/**
* The scale. Only applicable to numeric, decimal, time, datetime2 and datetimeoffset.
*/
scale?: number;
/**
* The length, for char, varchar, nvarchar and varbinary.
* The length, for char, varchar, nvarchar and varbinary.
*/
dataLength?: number;
}
export interface DebugOptions {
/**
* A boolean, controlling whether debug events will be emitted with text describing packet details (default: false).
@@ -58,13 +58,13 @@ declare module 'tedious' {
* A boolean, controlling whether debug events will be emitted with text describing packet payload details (default: false).
*/
payload?: boolean;
/**
* A boolean, controlling whether debug events will be emitted with text describing token stream tokens (default: false).
*/
token?: boolean;
}
export enum ISOLATION_LEVEL {
NO_CHANGE = 0x00,
READ_UNCOMMITTED = 0x01,
@@ -73,7 +73,7 @@ declare module 'tedious' {
SERIALIZABLE = 0x04,
SNAPSHOT = 0x05
}
/**
* Unfortunately these aren't valid JavaScript identifiers
* so I cannot list the values here as enum values
@@ -89,7 +89,7 @@ declare module 'tedious' {
type: string;
name: string;
}
export interface TediousTypes {
BigInt: TediousType;
Binary: TediousType;
@@ -130,82 +130,82 @@ declare module 'tedious' {
VarChar: TediousType;
Xml: TediousType;
}
export var TYPES: TediousTypes;
export interface ConnectionOptions {
/**
* Port to connect to (default: 1433). Mutually exclusive with options.instanceName.
*/
port?: number;
/**
* The instance name to connect to. The SQL Server Browser service must be running on the database server,
* and UDP port 1444 on the database server must be reachable. (no default) Mutually exclusive with options.port.
*/
instanceName?: string;
/**
* Database to connect to (default: dependent on server configuration).
*/
database?: string;
/**
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* then the user's default database will be * used instead (Default: false).
*/
fallbackToDefaultDb?: boolean;
/**
* The number of milliseconds before the attempt to connect is considered failed (default: 15000).
*/
connectTimeout?: number;
/**
* The number of milliseconds before a request is considered failed, or 0 for no timeout (default: 15000).
*/
requestTimeout?: number;
/**
* The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).
*/
cancelTimeout?: number;
/**
* The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).
*/
packetSize?: number;
/**
* A boolean determining whether to pass time values in UTC or local time. (default: true).
*/
useUTC?: boolean;
/**
* A boolean determining whether to rollback a transaction automatically if any error is encountered
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* SQL phase of a connection (documentation).
*/
abortTransactionOnError?: boolean;
/**
* A string indicating which network interface (ip addres) to use when connecting to SQL Server.
*/
localAddress?: string;
/**
* A boolean determining whether to return rows as arrays or key-value collections. (default: false).
*/
useColumnNames?: boolean;
/**
* A boolean, controlling whether the column names returned will have the first letter converted
* to lower case (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).
*/
camelCaseColumns?: boolean;
/**
* A function with parameters (columnName, index, columnMetaData) and returning a string. If provided,
* this will be called once per column per result-set. The returned value will be used instead of the
@@ -213,56 +213,56 @@ declare module 'tedious' {
* naming conventions. (default: null).
*/
columnNameReplacer?: (columnName: string, index: number, columnMetaData: ColumnMetaData) => string;
/**
* Debug options
*/
debug?: DebugOptions;
/**
* The default isolation level that transactions will be run with. (default: READ_COMMITED).
*/
isolationLevel?: ISOLATION_LEVEL;
/**
* The default isolation level for new connections. All out-of-transaction queries are executed with this setting. (default: READ_COMMITED)
*/
connectionIsolationLevel?: ISOLATION_LEVEL;
/**
* A boolean, determining whether the connection will request read only access from a SQL Server Availability Group. For more information, see here. (default: false).
*/
readOnlyIntent?: boolean;
/**
* A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure. (default: false).
*/
encrypt?: boolean;
/**
* When encryption is used, an object may be supplied that will be used for the first argument when calling tls.createSecurePair (default: {}).
*/
cryptoCredentialsDetails?: Object;
/**
* A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and doneProc. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnDone?: boolean;
/**
* A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnRequestCompletion?: boolean;
/**
* The version of TDS to use. If server doesn't support specified version, negotiated version is used instead. (default: 7_4).
* Take this from tedious.TDS_VERSION.7_4 .
*/
tdsVersion?: number;
}
export interface ConnectionConfig {
/**
* User name to use for authentication.
@@ -283,13 +283,13 @@ declare module 'tedious' {
* Once you set domain, driver will connect to SQL Server using domain login.
*/
domain?: string;
/**
* Further options
*/
options?: ConnectionOptions;
}
export interface ParameterOptions {
// for VarChar, NVarChar, VarBinary
length?: number;
@@ -298,7 +298,7 @@ declare module 'tedious' {
// scale for Numeric, Decimal, Time, DateTime2, DateTimeOffset
scale?: number;
}
/**
* Type of each column in the Request#row event
*/
@@ -306,7 +306,7 @@ declare module 'tedious' {
metadata: ColumnMetaData;
value: any;
}
/**
* A Request instance represents a request that can be executed on a connection
* @event 'columnMetadata' This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement.
@@ -317,7 +317,7 @@ declare module 'tedious' {
* @event 'returnValue' A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters.
*/
export class Request extends events.EventEmitter {
/**
* Constructor
* @param sql The SQL statement to be executed (or a procedure name, if the request is to be used with connection.callProcedure).
@@ -327,7 +327,7 @@ declare module 'tedious' {
* rows: Rows as a result of executing the SQL statement. Will only be avaiable if Connection's config.options.rowCollectionOnRequestCompletion is true.
*/
constructor(sql: string, callback: (error: Error, rowCount: number, rows: any[]) => void);
/**
* Add an input parameter to the request.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects. The name should not start '@'.
@@ -336,26 +336,26 @@ declare module 'tedious' {
* @param options Additional type options. Optional.
*/
addParameter(name: string, type: TediousType, value: any, options?: ParameterOptions): void;
/**
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects.
* @param type One of the supported data types.
* @param value The value that the parameter is to be given. The Javascript type of the argument should match that documented for data types. Optional.
* @param options Additional type options. Optional.
* @param options Additional type options. Optional.
*/
addOutputParameter(name: string, type: TediousType, value?: any, options?: ParameterOptions): void;
}
export interface BulkLoadColumnOpts extends ParameterOptions {
// indicates whether the column accepts NULL values.
nullable: boolean;
nullable: boolean;
// If the name of the column is different from the name of the property found on rowObj arguments passed to , then you can use this option to specify the property name.
objName?: string;
}
export interface BulkLoad {
/**
* Adds a column to the bulk load. The column definitions should match the table you are trying to insert into. Attempting to call addColumn after the first row has been added will throw an exception.
* @param name The name of the column.
@@ -363,7 +363,7 @@ declare module 'tedious' {
* @param options Additional column type information. At a minimum, nullable must be set to true or false.
*/
addColumn(name: string, type: TediousType, options: BulkLoadColumnOpts): void;
/**
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
* @param rowObj An object of key/value pairs representing column name (or objName) and value.
@@ -392,30 +392,30 @@ declare module 'tedious' {
export interface InfoObject {
/**
* Error number
*/
*/
number: number;
/**
* The error state, used as a modifier to the error number.
*/
*/
state: any;
/**
* The class (severity) of the error. A class of less than 10 indicates an informational message.
*/
*/
class: number;
/**
* The message text.
*/
*/
message: string;
/**
* The stored procedure name (if a stored procedure generated the message).
*/
*/
procName: string;
/**
* The line number in the SQL batch or stored procedure that caused the error. Line numbers begin at 1; therefore, if the line number is not applicable to the message, the value of LineNumber will be 0.
*/
*/
lineNumber: number;
}
/**
* Connection
* @event 'connect' The attempt to connect and validate has completed.
@@ -430,26 +430,26 @@ declare module 'tedious' {
* @event 'secure' A secure connection has been established.
*/
export class Connection extends events.EventEmitter {
constructor(config: ConnectionConfig);
/**
* Start a transaction. As only one request at a time may be executed on
* Start a transaction. As only one request at a time may be executed on
* a connection, another request should not be initiated until this callback is called.
* @param callback The callback is called when the request to start the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* @param name A string representing a name to associate with the transaction. Optional, and defaults to an empty string. Required when isolationLevel is present.
* @param isolationLevel The isolation level that the transaction is to be run with.
*/
beginTransaction(callback: (error?: Error) => void, name?: string, isolationLevel?: ISOLATION_LEVEL): void;
/**
* Commit a transaction.
* Commit a transaction.
* There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to commit the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
commitTransaction(callback: (error: Error) => void): void;
/**
* Rollback a transaction. There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to rollback the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
@@ -462,7 +462,7 @@ declare module 'tedious' {
* @param request A Request object representing the request. Parameters only require a name and type. Parameter values are ignored.
*/
prepare(request: Request): void;
/**
* Release the SQL Server resources associated with a previously prepared request.
*/
@@ -472,20 +472,20 @@ declare module 'tedious' {
* Call a stored procedure represented by request.
*/
callProcedure(request: Request): void;
/**
* Execute the SQL represented by request.
* As sp_executesql is used to execute the SQL, if the same SQL is executed multiples times using this function, the SQL Server query optimizer is likely to reuse the execution plan it generates for the first execution.
* Beware of the way that scoping rules apply, and how they may affect local temp tables. If you're running in to scoping issues, then execSqlBatch may be a better choice. See also issue #24.
*/
execSql(request: Request): void;
/**
* Execute the SQL batch represented by request. There is no param support, and unlike execSql, it is not likely that SQL Server will reuse the execution plan it generates for the SQL.
* In almost all cases, execSql will be a better choice.
*/
execSqlBatch(request: Request): void;
/**
* Execute previously prepared SQL, using the supplied parameters.
* @param request A previously prepared Request.
@@ -499,7 +499,7 @@ declare module 'tedious' {
* @param callback A function which will be called after the BulkLoad finishes executing. rowCount will equal the number of rows inserted.
*/
newBulkLoad(tableName: string, callback: (error: Error, rowCount: number) => void): BulkLoad;
/**
* Executes a BulkLoad.
*/
@@ -508,19 +508,19 @@ declare module 'tedious' {
/**
* Reset the connection to its initial state. Can be useful for connection pool implementations.
* @param callback The callback is called when the connection reset has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
reset(callback: (error: Error) => void): void;
/**
* Cancel currently executed request.
*/
cancel(): void;
/**
* Closes the connection to the database. The end will be emmited once the connection has been closed.
*/
close(): void;
}
}
+1 -1
View File
@@ -316,7 +316,7 @@ declare module Tee {
calc(value: number): number;
fromPos(position: number): number;
fromSize(size: number): number;
hasAnySeries(): boolean;
scroll(delta: number): void;
setMinMax(minimum: number, maximum: number): void;
+1 -1
View File
@@ -8,7 +8,7 @@ interface DetectorStatic {
webgl: boolean;
workers: boolean;
fileapi: boolean;
getWebGLErrorMessage(): HTMLElement;
addGetWebGLMessage(parameters?: {id?: string; parent?: HTMLElement}): void;
}
+1 -1
View File
@@ -17,7 +17,7 @@ declare module THREE {
readBuffer: WebGLRenderTarget;
passes: any[];
copyPass: ShaderPass;
swapBuffers(): void;
addPass(pass: any): void;
insertPass(pass: any, index: number): void;
+1 -1
View File
@@ -18,7 +18,7 @@ declare module THREE {
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
}
export class ClearMaskPass {
constructor();
+2 -2
View File
@@ -51,11 +51,11 @@ declare module THREE {
reset(): void;
getPolarAngle(): number;
getAzimuthalAngle(): number;
// EventDispatcher mixins
addEventListener(type: string, listener: (event: any) => void): void;
hasEventListener(type: string, listener: (event: any) => void): void;
removeEventListener(type: string, listener: (event: any) => void): void;
dispatchEvent(event: { type: string; target: any; }): void;
}
}
}
+4 -4
View File
@@ -72,7 +72,7 @@ declare module THREE {
*/
export class Projector {
constructor();
// deprecated.
projectVector(vector: Vector3, camera: Camera): Vector3;
@@ -88,10 +88,10 @@ declare module THREE {
* @param sort select whether to sort elements using the Painter's algorithm.
*/
projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): {
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
lights: Light[];
elements: Face3[]; // Line, Particle, Face3 or Face4
};
}
}
}
+2 -2
View File
@@ -4618,7 +4618,7 @@ declare module THREE {
getMaxAnisotropy(): number;
getPixelRatio(): number;
setPixelRatio(value: number): void;
getSize(): { width: number; height: number; };
/**
@@ -4960,7 +4960,7 @@ declare module THREE {
export class WebGLProgram{
constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters);
getUniforms(): any;
getAttributes(): any;
+1 -1
View File
@@ -8,7 +8,7 @@
declare module 'through2' {
import stream = require('stream');
type TransfofmCallback = (err?: any, data?: any) => void;
type TransformFunction = (chunk: any, enc: string, callback: TransfofmCallback) => void;
type FlashCallback = (flushCallback: () => void) => void;
+6 -7
View File
@@ -275,27 +275,27 @@ declare module '__timezonecomplete/basics' {
/**
* Year, 1970-...
*/
year?: number,
year?: number,
/**
* Month 1-12
*/
month?: number,
month?: number,
/**
* Day of month, 1-31
*/
day?: number,
day?: number,
/**
* Hour 0-23
*/
hour?: number,
hour?: number,
/**
* Minute 0-59
*/
minute?: number,
minute?: number,
/**
* Seconds, 0-59
*/
second?: number,
second?: number,
/**
* Milliseconds 0-999
*/
@@ -1517,4 +1517,3 @@ declare module '__timezonecomplete/globals' {
*/
export function abs(d: Duration): Duration;
}
+1 -1
View File
@@ -329,7 +329,7 @@ interface tinycolorInstance {
* Gets the complement of the current color
*/
complement(): tinycolorInstance;
/**
* Gets a new instance with the current color
*/
+5 -5
View File
@@ -6,13 +6,13 @@ function test_window() {
backgroundColor: 'white',
borderRadius: 10
});
window.setBackgroundColor('blue');
window.opacity = 0.92;
var matrix = Ti.UI.create2DMatrix().scale(1.1, 1);
window.transform = matrix;
var label: Ti.UI.Label;
label = Ti.UI.createLabel({
color: '#900',
@@ -100,7 +100,7 @@ function test_map() {
mountainView.setTitle('Appcelerator');
mountainView.setSubtitle('Mountain View, CA');
mountainView.setPincolor(Ti.Map.ANNOTATION_RED);
var mapview = Ti.Map.createView({
mapType: Ti.Map.STANDARD_TYPE,
region: {
@@ -118,4 +118,4 @@ function test_map() {
});
win.add(mapview);
win.open();
}
}
+2 -2
View File
@@ -6342,8 +6342,8 @@ declare class ErrorCallbackArgs {
}
declare class FailureResponse {
code: Number;
error: string;
code: Number;
error: string;
success: boolean;
}
+4 -4
View File
@@ -9,7 +9,7 @@ declare module "tmp" {
interface Options extends SimpleOptions {
mode?: number;
}
interface SimpleOptions {
prefix?: string;
postfix?: string;
@@ -19,7 +19,7 @@ declare module "tmp" {
keep?: boolean;
unsafeCleanup?: boolean;
}
interface SynchrounousResult {
name: string;
fd: number;
@@ -28,9 +28,9 @@ declare module "tmp" {
function file(callback: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function file(config: Options, callback?: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function fileSync(config?: Options): SynchrounousResult;
function dir(callback: (err: any, path: string, cleanupCallback: () => void) => void): void;
function dir(config: Options, callback?: (err: any, path: string, cleanupCallback: () => void) => void): void;
+13 -13
View File
@@ -13,7 +13,7 @@ declare module JQueryTooltipster {
export interface ITooltipsterOptions {
/**
* Determines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file.
* Determines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file.
* In IE9 and 8, all animations default to a JavaScript generated, fade animation. Default: 'fade'
*/
animation?: string;
@@ -39,7 +39,7 @@ declare module JQueryTooltipster {
content?: string;
/**
* If the content of the tooltip is provided as a string, it is displayed as plain text by default.
* If the content of the tooltip is provided as a string, it is displayed as plain text by default.
* If this content should actually be interpreted as HTML, set this option to true. Default: false
*/
contentAsHTML?: boolean;
@@ -127,13 +127,13 @@ declare module JQueryTooltipster {
iconTouch?: boolean;
/**
* Give users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip.
* Give users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip.
* Default: false
*/
interactive?: boolean;
/**
* If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off
* If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off
* of the tooltip activator (origin) on to the tooltip itself - keeping the tooltip from closing. Default: 350
*/
interactiveTolerance?: number;
@@ -170,14 +170,14 @@ declare module JQueryTooltipster {
positionTracker?: boolean;
/**
* Called after the tooltip has been repositioned by the position tracker (if enabled).
* Called after the tooltip has been repositioned by the position tracker (if enabled).
* Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false.
*/
positionTrackerCallback?: Function;
/**
* Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method.
* This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content.
* Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method.
* This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content.
* Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current'
*
* Possible values: 'none', 'previous' or 'current'
@@ -200,8 +200,8 @@ declare module JQueryTooltipster {
theme?: string;
/**
*
* If set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method.
*
* If set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method.
* Touch gestures on devices which also have a mouse will still open the tooltips though. Default: true
*/
touchDevices?: boolean;
@@ -225,8 +225,8 @@ declare module JQueryTooltipster {
/**
* Updates the content of the tooltip.
* @param value
* @returns {}
* @param value
* @returns {}
*/
content(value: string): JQuery;
@@ -254,7 +254,7 @@ declare module JQueryTooltipster {
* Destroy the tooltip and its listeners.
*/
destroy(): void;
/**
* Reposition and resize the tooltip.
*/
@@ -275,4 +275,4 @@ declare module JQueryTooltipster {
interface JQuery {
tooltipster(options?: JQueryTooltipster.ITooltipsterOptions): JQuery|JQueryTooltipster.ITooltipsterInstance[];
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module tv4 {
// Note that every top-level property is optional in json-schema
export interface JsonSchema {
[key: string]: any;
@@ -15,7 +15,7 @@ declare module tv4 {
type?: string;
items?: any;
properties?: any;
patternProperties?: any;
patternProperties?: any;
additionalProperties?: boolean;
required?: string[];
definitions?: any;
+1 -1
View File
@@ -10,7 +10,7 @@ declare module TWEEN {
export function add(tween:Tween): void;
export function remove(tween:Tween): void;
export function update(time?:number): boolean;
export class Tween {
constructor(object?:any);
to(properties:any, duration:number): Tween;
+1 -1
View File
@@ -67,7 +67,7 @@ declare module createjs {
static sineInOut: (amount: number) => number;
static sineOut: (amount: number) => number;
}
export class MotionGuidePlugin {
constructor();
+1 -1
View File
@@ -80,7 +80,7 @@ function bindLoadedEvent() {
);
}
function bindRenderedEvent() {
function bindRenderedEvent() {
twttr.events.bind(
"rendered",
event => {
+79 -79
View File
@@ -712,19 +712,19 @@ interface JQuery {
declare module Twitter.Typeahead {
interface Options {
/**
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}.
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}.
* Defaults to false.
*/
highlight?: boolean;
/**
* If false, the typeahead will not show a hint.
* If false, the typeahead will not show a hint.
* Defaults to true.
*/
hint?: boolean;
/**
* The minimum character length needed before suggestions start getting rendered.
* The minimum character length needed before suggestions start getting rendered.
* Defaults to 1.
*/
minLength?: number;
@@ -736,14 +736,14 @@ declare module Twitter.Typeahead {
}
/**
* A typeahead is composed of one or more datasets. When an end-user
* modifies the value of a typeahead, each dataset will attempt to render
* A typeahead is composed of one or more datasets. When an end-user
* modifies the value of a typeahead, each dataset will attempt to render
* suggestions for the new value.
* For most use cases, one dataset should suffice. It's only in the scenario
* where you want rendered suggestions to be grouped based on some sort of
* categorical relationship that you'd need to use multiple datasets. For
* example, on twitter.com, the search typeahead groups results into recent
* searches, trends, and accounts – that would be a great use case for using
* example, on twitter.com, the search typeahead groups results into recent
* searches, trends, and accounts – that would be a great use case for using
* multiple datasets.
*/
interface Dataset<T> {
@@ -751,23 +751,23 @@ declare module Twitter.Typeahead {
* The backing data source for suggestions.
* Expected to be a function with the signature (query, syncResults, asyncResults).
* syncResults should be called with suggestions computed synchronously and
* asyncResults should be called with suggestions computed asynchronously
* asyncResults should be called with suggestions computed asynchronously
* (e.g. suggestions that come for an AJAX request).
* source can also be a Bloodhound instance.
* source can also be a Bloodhound instance.
*/
source: Bloodhound<T> | ((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void);
/**
* Lets the dataset know if async suggestions should be expected.
* If not set, this information is inferred from the signature of
* source i.e. if the source function expects 3 arguments, async will
* Lets the dataset know if async suggestions should be expected.
* If not set, this information is inferred from the signature of
* source i.e. if the source function expects 3 arguments, async will
* be set to true.
*/
async?: boolean;
/**
* The name of the dataset.
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element.
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element.
* Must only consist of underscores, dashes, letters (a-z), and numbers.
* Defaults to a random number.
*/
@@ -779,16 +779,16 @@ declare module Twitter.Typeahead {
limit?: number;
/**
* For a given suggestion, determines the string representation of it.
* This will be used when setting the value of the input control after
* a suggestion is selected. Can be either a key string or a function
* that transforms a suggestion object into a string.
* For a given suggestion, determines the string representation of it.
* This will be used when setting the value of the input control after
* a suggestion is selected. Can be either a key string or a function
* that transforms a suggestion object into a string.
* Defaults to stringifying the suggestion.
*/
display?: string | ((obj: T) => string);
/**
* A hash of templates to be used when rendering the dataset. Note a
* A hash of templates to be used when rendering the dataset. Note a
* precompiled template is a function that takes a JavaScript object as
* its first argument and returns a HTML string.
*/
@@ -796,7 +796,7 @@ declare module Twitter.Typeahead {
}
/**
* A hash of templates to be used when rendering the dataset. Note a
* A hash of templates to be used when rendering the dataset. Note a
* precompiled template is a function that takes a JavaScript object as
* its first argument and returns a HTML string.
*/
@@ -816,22 +816,22 @@ declare module Twitter.Typeahead {
pending?: string | ((query: string) => string);
/**
* Rendered at the top of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* Rendered at the top of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* query and suggestions.
*/
header?: string | ((query: string, suggestions: T[]) => string);
/**
* Rendered at the bottom of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* a precompiled template. If it's a precompiled template, the passed in context will contain
* query and suggestions.
*/
footer?: string | ((query: string, suggestions: T[]) => string);
/**
* Used to render a single suggestion. If set, this has to be a precompiled template.
* The associated suggestion object will serve as the context.
* Used to render a single suggestion. If set, this has to be a precompiled template.
* The associated suggestion object will serve as the context.
* Defaults to the value of display wrapped in a div tag i.e. <div>{{value}}</div>.
*/
suggestion?: (suggestion: T) => string;
@@ -854,16 +854,16 @@ declare module Twitter.Typeahead {
/**
* Added to menu element.Defaults to tt- menu.
*/
menu?: string;
menu?: string;
/**
* Added to dataset elements.to Defaults to tt- dataset.
*/
dataset?: string;
dataset?: string;
/**
* Added to suggestion elements.Defaults to tt- suggestion.
*/
suggestion?: string;
suggestion?: string;
/**
* Added to menu element when it contains no content.Defaults to tt- empty.
@@ -873,7 +873,7 @@ declare module Twitter.Typeahead {
/**
* Added to menu element when it is opened.Defaults to tt- open.
*/
open?: string;
open?: string;
/**
* Added to suggestion element when menu cursor moves to said suggestion.Defaults to tt- cursor.
@@ -891,7 +891,7 @@ declare module Bloodhound {
interface BloodhoundOptions<T> {
/**
* Transforms a datum into an array of string tokens.
*
*
* @param datum Suggestion.
* @returns An array of string tokens.
*/
@@ -899,38 +899,38 @@ declare module Bloodhound {
/**
* Transforms a query into an array of string tokens.
*
*
* @param quiery Query.
* @returns An array of string tokens.
*/
queryTokenizer: (query: string) => string[];
/**
* If set to false, the Bloodhound instance will not be implicitly
* If set to false, the Bloodhound instance will not be implicitly
* initialized by the constructor function. Defaults to true.
*/
initialize?: boolean;
/**
* Given a datum, returns a unique id for it.
* Defaults to JSON.stringify. Note that it is highly recommended
* Given a datum, returns a unique id for it.
* Defaults to JSON.stringify. Note that it is highly recommended
* to override this option.
*
*
* @param datum Suggestion.
* @returns Unique id for the suggestion.
*/
identify?: (datum: T) => number;
/**
* If the number of datums provided from the internal search index is
* less than sufficient, remote will be used to backfill search
* If the number of datums provided from the internal search index is
* less than sufficient, remote will be used to backfill search
* requests triggered by calling #search. Defaults to 5.
*/
sufficient?: number;
/**
* A compare function used to sort data returned from the internal search index.
*
*
* @param a First suggestion.
* @param b Second suggestion.
* @returns Comparison result.
@@ -938,20 +938,20 @@ declare module Bloodhound {
sorter?: (a: T, b: T) => number;
/**
* An array of data or a function that returns an array of data.
* An array of data or a function that returns an array of data.
* The data will be added to the internal search index when #initialize is called.
*/
local?: T[] | (() => T[]);
/**
* Can be a URL to a JSON file containing an array of data or,
* Can be a URL to a JSON file containing an array of data or,
* if more configurability is needed, a prefetch options hash.
*/
prefetch?: string | PrefetchOptions<T>;
/**
* Can be a URL to fetch data from when the data provided by the internal
* search index is insufficient or, if more configurability is needed,
* search index is insufficient or, if more configurability is needed,
* a remote options hash.
*/
remote?: string | RemoteOptions<T>;
@@ -962,7 +962,7 @@ declare module Bloodhound {
* supports local storage, the processed data will be cached there to prevent
* additional network requests on subsequent page loads.
*
* WARNING: While it's possible to get away with it for smaller data sets,
* WARNING: While it's possible to get away with it for smaller data sets,
* prefetched data isn't meant to contain entire sets of data. Rather, it should
* act as a first-level cache. Ignoring this warning means you'll run the risk
* of hitting local storage limits.
@@ -974,31 +974,31 @@ declare module Bloodhound {
url: string;
/**
* If false, will not attempt to read or write to local storage and
* If false, will not attempt to read or write to local storage and
* will always load prefetch data from url on initialization. Defaults to true.
*/
cache?: boolean;
/**
* The time (in milliseconds) the prefetched data should be cached in
* The time (in milliseconds) the prefetched data should be cached in
* local storage. Defaults to 86400000 (1 day).
*/
ttl?: number;
/**
* The key that data will be stored in local storage under.
* The key that data will be stored in local storage under.
* Defaults to value of url.
*/
cacheKey?: string;
/**
* A string used for thumbprinting prefetched data. If this doesn't
* A string used for thumbprinting prefetched data. If this doesn't
* match what's stored in local storage, the data will be refetched.
*/
thumbprint?: string;
/**
* A function that provides a hook to allow you to prepare the settings
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* Defaults to the identity function.
*
@@ -1008,10 +1008,10 @@ declare module Bloodhound {
prepare?: (settings: JQueryAjaxSettings) => JQueryAjaxSettings;
/**
* A function with the signature transform(response) that allows you to
* transform the prefetch response before the Bloodhound instance operates
* A function with the signature transform(response) that allows you to
* transform the prefetch response before the Bloodhound instance operates
* on it. Defaults to the identity function.
*
*
* @param response Prefetch response.
* @returns Transform response.
*/
@@ -1019,8 +1019,8 @@ declare module Bloodhound {
}
/**
* Bloodhound only goes to the network when the internal search engine cannot
* provide a sufficient number of results. In order to prevent an obscene
* Bloodhound only goes to the network when the internal search engine cannot
* provide a sufficient number of results. In order to prevent an obscene
* number of requests being made to the remote endpoint, requests are rate-limited.
*/
interface RemoteOptions<T> {
@@ -1030,13 +1030,13 @@ declare module Bloodhound {
url: string;
/**
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* The function signature should be prepare(query, settings), where query
* is the query #search was called with and settings is the default settings
* object created internally by the Bloodhound instance. The prepare function
* should return a settings object. Defaults to the identity function.
*
*
* @param query The query #search was called with.
* @param settings The default settings object created internally by Bloodhound.
* @returns A JqueryAjaxSettings object.
@@ -1050,22 +1050,22 @@ declare module Bloodhound {
wildcard?: string;
/**
* The method used to rate-limit network requests.
* The method used to rate-limit network requests.
* Can be either debounce or throttle. Defaults to debounce.
*/
rateLimitby?: string;
/**
* The time interval in milliseconds that will be used by rateLimitBy.
* The time interval in milliseconds that will be used by rateLimitBy.
* Defaults to 300.
*/
rateLimitWait?: number;
/**
* A function with the signature transform(response) that allows you to
* transform the remote response before the Bloodhound instance operates on it.
* transform the remote response before the Bloodhound instance operates on it.
* Defaults to the identity function.
*
*
* @param response Prefetch response.
* @returns Transform response.
*/
@@ -1080,7 +1080,7 @@ declare module Bloodhound {
* Split a given string on whitespace characters.
*/
whitespace(str: string): string[];
/**
* Split a given string on non-word characters.
*/
@@ -1106,21 +1106,21 @@ declare module Bloodhound {
}
/**
* Bloodhound is the typeahead.js suggestion engine. Bloodhound is robust,
* flexible, and offers advanced functionalities such as prefetching,
* Bloodhound is the typeahead.js suggestion engine. Bloodhound is robust,
* flexible, and offers advanced functionalities such as prefetching,
* intelligent caching, fast lookups, and backfilling with remote data.
*/
declare class Bloodhound<T> {
/**
* The constructor function.
*
*
* @constructor
* @param options Options hash.
*/
constructor(options: Bloodhound.BloodhoundOptions<T>);
/**
* Returns a reference to Bloodhound and reverts window.Bloodhound to its
* Returns a reference to Bloodhound and reverts window.Bloodhound to its
* previous value. Can be used to avoid naming collisions.
*/
public static noConflict(): Bloodhound<any>;
@@ -1132,17 +1132,17 @@ declare class Bloodhound<T> {
public static tokenizers: Bloodhound.Tokenizers;
/**
* Kicks off the initialization of the suggestion engine. Initialization
* entails adding the data provided by local and prefetch to the internal
* search index as well as setting up transport mechanism used by remote.
* Kicks off the initialization of the suggestion engine. Initialization
* entails adding the data provided by local and prefetch to the internal
* search index as well as setting up transport mechanism used by remote.
* Before #initialize is called, the #get and #search methods will effectively be no-ops.
*
* Note, unless the initialize option is false, this method is implicitly called by the constructor.
*
* After initialization, how subsequent invocations of #initialize behave depends on
* the reinitialize argument. If reinitialize is falsy, the method will not execute the
* initialization logic and will just return the same jQuery promise returned
* by the initial invocation. If reinitialize is truthy, the method will behave
*
* After initialization, how subsequent invocations of #initialize behave depends on
* the reinitialize argument. If reinitialize is falsy, the method will not execute the
* initialization logic and will just return the same jQuery promise returned
* by the initial invocation. If reinitialize is truthy, the method will behave
* as if it were being called for the first time.
*
* @param reinitialize How subsequent invocations of #initialize will behave.
@@ -1151,7 +1151,7 @@ declare class Bloodhound<T> {
public initialize(reinitialize?: boolean): JQueryPromise<T>;
/**
* Takes one argument, data, which is expected to be an array.
* Takes one argument, data, which is expected to be an array.
* The data passed in will get added to the internal search index.
*
* @param data Data to be added to the internal search index.
@@ -1167,11 +1167,11 @@ declare class Bloodhound<T> {
public get(ids: number[]): T[];
/**
* Returns the data that matches query. Matches found in the local search
* index will be passed to the sync callback. If the data passed to sync
* doesn't contain at least sufficient number of datums, remote data will
* Returns the data that matches query. Matches found in the local search
* index will be passed to the sync callback. If the data passed to sync
* doesn't contain at least sufficient number of datums, remote data will
* be requested and then passed to the async callback.
*
*
* @param query Query.
* @param sync Sync callback
* @param async Async callback.
+1 -1
View File
@@ -42,6 +42,6 @@ declare module "typescript-deferred" {
export function create<T>(): DeferredInterface<T>;
export function when<T>(value?: ThenableInterface<T>): PromiseInterface<T>;
export function when<T>(value?: T): PromiseInterface<T>;
}