mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
+19
-19
@@ -22,15 +22,15 @@ Este es el método preferido. Solo está disponible para usuarios TypeScript 2.0
|
||||
npm install --save-dev @types/node
|
||||
```
|
||||
|
||||
Los types deberían ser incluidos automaticamente por el compilador.
|
||||
Los types deberían ser incluidos automáticamente por el compilador.
|
||||
Vea más en el [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html).
|
||||
|
||||
Para un paquete NPM "foo", Estos `typings` estarán en "@types/foo".
|
||||
Para un paquete NPM "foo", estos `typings` estarán en "@types/foo".
|
||||
Si no puedes encontrar tu paquete, búscalo en [TypeSearch](https://microsoft.github.io/TypeSearch/).
|
||||
|
||||
Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) los typings.
|
||||
Esto es provisto usualmente en el campo `"types"` o `"typings"` en el `package.json`,
|
||||
o solo busca por cualquier archivo ".d.ts" en el paquete e incluyelo manualmente con un `/// <reference path="" />`.
|
||||
o solo busca por cualquier archivo ".d.ts" en el paquete e inclúyelo manualmente con un `/// <reference path="" />`.
|
||||
|
||||
|
||||
### Otros métodos
|
||||
@@ -39,7 +39,7 @@ Estos pueden ser utilizados por TypeScript 1.0.
|
||||
|
||||
* [Typings](https://github.com/typings/typings)
|
||||
* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (use las alternativas preferidas, la publicación DT type de nuget ha sido desactivada)
|
||||
* Descarguelo manualmente desde la `master` branch de este repositorio
|
||||
* Descárguelo manualmente desde la `master` branch de este repositorio
|
||||
|
||||
Tal vez debas añadir manualmente las [referencias](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html).
|
||||
|
||||
@@ -88,7 +88,7 @@ Primero, haz un [fork](https://guides.github.com/activities/forking/) en este re
|
||||
* `cd types/my-package-to-edit`
|
||||
* Haz cambios. Recuerda editar las pruebas.
|
||||
Si realiza cambios importantes, no olvide [actualizar una versión principal](#quiero-actualizar-un-paquete-a-una-nueva-versión-principal).
|
||||
* También puede que quieras añadirte la sección "Definitions by" en el encabezado del paquete.
|
||||
* También puede que quieras añadirle la sección "Definitions by" en el encabezado del paquete.
|
||||
- Esto hará que seas notificado (a través de tu nombre de usuario en GitHub) cada vez que alguien haga un pull request o issue sobre el paquete.
|
||||
- Haz esto añadiendo tu nombre al final de la línea, así como en `// Definitions by: Alice <https://github.com/alice>, Bob <https://github.com/bob>`.
|
||||
- O si hay más personas, puede ser multiline
|
||||
@@ -109,7 +109,7 @@ Si no lo hace, puedes hacerlo en el comentario asociado con el PR.
|
||||
Si eres el autor de la librería, o puedes hacer un pull request a la biblioteca, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) en vez de publicarlo en DefinitelyTyped.
|
||||
|
||||
Si estás agregando typings para un paquete NPM, crea un directorio con el mismo nombre.
|
||||
Si el paquete al que le estás agregando typings no es para NPM, asegurate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM.
|
||||
Si el paquete al que le estás agregando typings no es para NPM, asegúrate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM.
|
||||
(Puedes usar `npm info foo` para verificar la existencia del paquete `foo`.)
|
||||
|
||||
Tu paquete debería tener esta estructura:
|
||||
@@ -126,7 +126,7 @@ Ve todas las opciones en [dts-gen](https://github.com/Microsoft/dts-gen).
|
||||
|
||||
También puedes configurar el `tsconfig.json` para añadir nuevos archivos, para agregar un `"target": "es6"` (necesitado por las funciones asíncronas), para agregar a la `"lib"`, o para agregar la opción de compilación `"jsx"`.
|
||||
|
||||
Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrian ralentizar el proceso.
|
||||
Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrían ralentizar el proceso.
|
||||
|
||||
Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js).
|
||||
|
||||
@@ -135,7 +135,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy
|
||||
|
||||
* Primero, sigue el consejo del [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html).
|
||||
* Formatear: Ya sea utilizar todo en tabs, o siempre utiliza 4 espacios.
|
||||
* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una funcion no escribe a sus parámetros.
|
||||
* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una función no escribe a sus parámetros.
|
||||
* `interface Foo { new(): Foo; }`:
|
||||
Este define el tipo de objeto que esten nuevos. Probablemente quieras `declare class Foo { constructor(); }`.
|
||||
* `const Class: { new(): IClass; }`:
|
||||
@@ -146,7 +146,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy
|
||||
Un ejemplo donde un tipo de parámetro es aceptable: `function id<T>(value: T): T;`.
|
||||
Un ejemplo donde no es aceptable: `function parseJson<T>(json: string): T;`.
|
||||
Una excepción: `new Map<string, number>()` está bien.
|
||||
* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más especifico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`.
|
||||
* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más específico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`.
|
||||
* `var foo: string | any`:
|
||||
Cuando es usado `any` en un tipo de unión, el tipo resultante todavía es `any`. Así que mientras la porción `string` de este tipo de anotación puede _verse_ útil, de hecho, no ofrece ningún typechecking adicional más que un simple `any`.
|
||||
Dependiendo de la intención, una alternativa aceptable puede ser `any`, `string`, o `string | object`.
|
||||
@@ -204,11 +204,11 @@ Este script utiliza [dtslint](https://github.com/Microsoft/dtslint).
|
||||
|
||||
#### ¿Cuál es exactamente la relación entre este repositorio y los paquetes de `@types` en NPM?
|
||||
|
||||
La `master` branch es automaticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher).
|
||||
La `master` branch es automáticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher).
|
||||
|
||||
#### He enviado un pull request. ¿Cuánto tardará en ser merged?
|
||||
|
||||
Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprovados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor se paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan on los PRs abiertos.
|
||||
Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprobados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor sé paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan en los PRs abiertos.
|
||||
|
||||
#### Mi PR ha sido merged; ¿cuándo será actualizado el paquete de `@types` NPM?
|
||||
|
||||
@@ -216,12 +216,12 @@ Los paquetes NPM deberán ser actualizados en unas cuantas horas. Si ha pasado m
|
||||
|
||||
#### Estoy escribiendo una definición que depende de otra definición. Debería utilizar `<reference types="" />` o una import?
|
||||
|
||||
Si el modulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import.
|
||||
Si el módulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import.
|
||||
Si el módulo al cual te refieres es un módulo ambiente (utiliza `declare module`, o simplemente declara las globales), utilice `<reference types="" />`.
|
||||
|
||||
#### He notado que algunos paquetes aquí tienen `package.json`.
|
||||
|
||||
Normalmente no lo necesitaras. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso.
|
||||
Normalmente no lo necesitarás. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso.
|
||||
Un `package.json` puede ser incluido por el bien de especificar dependencias. Aquí tienen un [ejemplo](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json).
|
||||
No aceptamos otros campos, tales como `"description"`, para que sean definidos manualmente.
|
||||
Además, si necesitas referencia a una versión anterior de typings, debes hacerlo añadiendo `"dependencies": { "@types/foo": "x.y.z" }` al package.json.
|
||||
@@ -260,7 +260,7 @@ Cuando ya no sea un borrador, lo podremos eliminar desde DefinitelyType y hacer
|
||||
Si planeas continuar actualizando la versión anterior del paquete, puedes crear una subcarpeta con la versión actual p.ej. `v2`, y copia los archivos existentes. Si es así, necesitarás:
|
||||
|
||||
1. Actualiza las rutas relativas en `tsconfig.json` al igual que `tslint.json`.
|
||||
2. Añadir reglas de mapeo de rutas para asegurart de que la prueba se está ejecutando contra la versión prevista.
|
||||
2. Añadir reglas de mapeo de rutas para asegurarte de que la prueba se está ejecutando contra la versión prevista.
|
||||
|
||||
Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) se ve así:
|
||||
|
||||
@@ -280,24 +280,24 @@ Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi
|
||||
}
|
||||
```
|
||||
|
||||
Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitaras mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior.
|
||||
Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitarás mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior.
|
||||
|
||||
Por ejemplo, `react-router` depende de `history@2`, así que [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) tiene una ruta mapeada a "history": `[ "history/v2" ]`;
|
||||
transitivo así mismo, `react-router-bootstrap` (que depende de `react-router`) también añade una ruta mapeada en su [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json).
|
||||
|
||||
Además, `/// <reference types=".." />` no trabajara con rutas mapeadas, así que las dependencias deberán utilizar `import`.
|
||||
Además, `/// <reference types=".." />` no trabajará con rutas mapeadas, así que las dependencias deberán utilizar `import`.
|
||||
|
||||
#### ¿Cómo escribo definitions para paquetes que pueden ser usados globalmente y como un módulo?
|
||||
|
||||
El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), ademas [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada practicamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a travéz de una etiqueta script en una página web, o importada via require o imports estilo ES6.
|
||||
El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), además [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada prácticamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a través de una etiqueta script en una página web, o importada vía require o imports estilo ES6.
|
||||
|
||||
Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas un propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js.
|
||||
Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas una propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js.
|
||||
|
||||
Por favor tenga en cuenta que no es necesario para ejercer plenamente la definición en cada archivo de prueba - Es suficiente con probar solo los elementos globalmente accesibles en la prueba de archivos globales y ejercer la definición en el módulo del archivo de prueba, o viceversa.
|
||||
|
||||
#### ¿Qué pasa con paquetes scoped?
|
||||
|
||||
Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guion bajo.
|
||||
Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guión bajo.
|
||||
|
||||
Cuando `dts-gen` es utilizado como scaffold en un paquete scoped, las propiedades `paths` deberán ser adaptadas manualmente en el paquete generado
|
||||
`tsconfig.json` para referenciar correctamente el paquete scoped:
|
||||
|
||||
@@ -930,6 +930,12 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/lower-case-first",
|
||||
"asOfVersion": "1.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "mali",
|
||||
"typingsPackageName": "mali",
|
||||
"sourceRepoURL": "https://github.com/malijs/mali",
|
||||
"asOfVersion": "0.9.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "maquette",
|
||||
"typingsPackageName": "maquette",
|
||||
@@ -1200,6 +1206,12 @@
|
||||
"sourceRepoURL": "https://github.com/react-ga/react-ga",
|
||||
"asOfVersion": "2.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-i18next",
|
||||
"typingsPackageName": "react-i18next",
|
||||
"sourceRepoURL": "https://github.com/i18next/react-i18next",
|
||||
"asOfVersion": "8.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-monaco-editor",
|
||||
"typingsPackageName": "react-monaco-editor",
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { parse, stringify } from 'ale-url-parser';
|
||||
|
||||
let url;
|
||||
let urlObject;
|
||||
|
||||
url = stringify({});
|
||||
console.log(url);
|
||||
|
||||
url = stringify({
|
||||
protocol: 'protocol',
|
||||
host: 'host',
|
||||
path: ['foo', 'bar', 'baz'],
|
||||
hash: 'hash',
|
||||
query: {
|
||||
foo: 1,
|
||||
bar: [2, '3']
|
||||
}
|
||||
});
|
||||
console.log(url);
|
||||
|
||||
urlObject = parse('//any.dom.ain.co.m/foo/bar?test=1&test=2#hash');
|
||||
console.log(urlObject);
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for ale-url-parser 0.10
|
||||
// Project: https://github.com/msn0/ale-url-parser#readme
|
||||
// Definitions by: Michał Jezierski <https://github.com/msn0>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export interface QueryParams {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface UrlObject {
|
||||
protocol?: string;
|
||||
host?: string;
|
||||
path?: string[];
|
||||
query?: QueryParams;
|
||||
hash?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse url string into url object.
|
||||
* @return UrlObject
|
||||
*/
|
||||
export function parse(url: string): UrlObject;
|
||||
|
||||
/**
|
||||
* Stringify url object into url string.
|
||||
* @return string
|
||||
*/
|
||||
export function stringify(urlObject: UrlObject): string;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ale-url-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -21,6 +21,7 @@ let _algoliaResponse: Response = {
|
||||
processingTimeMS: 32,
|
||||
query: '',
|
||||
params: '',
|
||||
index: '',
|
||||
};
|
||||
|
||||
let _clientOptions: ClientOptions = {
|
||||
@@ -103,7 +104,7 @@ let _algoliaQueryParameters: QueryParameters = {
|
||||
filters: '',
|
||||
attributesToRetrieve: [''],
|
||||
restrictSearchableAttributes: [''],
|
||||
facets: '',
|
||||
facets: [''],
|
||||
facetingAfterDistinct: true,
|
||||
maxValuesPerFacet: 2,
|
||||
attributesToHighlight: [''],
|
||||
@@ -121,28 +122,29 @@ let _algoliaQueryParameters: QueryParameters = {
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
disableTypoToleranceOnAttributes: [''],
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: 0,
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: [[0]],
|
||||
queryType: '',
|
||||
queryType: 'prefixAll',
|
||||
insidePolygon: [[0]],
|
||||
removeWordsIfNoResults: '',
|
||||
removeWordsIfNoResults: 'firstWords',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
removeStopWords: [''],
|
||||
disableExactOnAttributes: [''],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: true,
|
||||
exactOnSingleWordQuery: 'attribute',
|
||||
alternativesAsExact: ["ignorePlurals"],
|
||||
distinct: 0,
|
||||
getRankingInfo: false,
|
||||
numericAttributesToIndex: [''],
|
||||
numericAttributesForFiltering: [''],
|
||||
numericFilters: [''],
|
||||
tagFilters: '',
|
||||
facetFilters: '',
|
||||
tagFilters: [''],
|
||||
facetFilters: [''],
|
||||
analytics: false,
|
||||
analyticsTags: [''],
|
||||
synonyms: true,
|
||||
@@ -172,8 +174,38 @@ index.partialUpdateObjects([{}], false).then(() => {});
|
||||
let indexName : string = index.indexName;
|
||||
|
||||
// complete copy
|
||||
client.copyIndex('from', 'to').then(()=>{})
|
||||
client.copyIndex('from', 'to', ()=> {})
|
||||
client.copyIndex('from', 'to').then(()=>{});
|
||||
client.copyIndex('from', 'to', ()=> {});
|
||||
// with scope
|
||||
client.copyIndex('from', 'to', ['settings']).then(()=>{})
|
||||
client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {})
|
||||
client.copyIndex('from', 'to', ['settings']).then(()=>{});
|
||||
client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {});
|
||||
|
||||
// Browsing
|
||||
const browser = index.browseAll();
|
||||
index.browseAll('query');
|
||||
index.browseAll('', {
|
||||
filters: 'dog',
|
||||
});
|
||||
|
||||
let hits: Object[] = [];
|
||||
|
||||
browser.on('result', function onResult(content) {
|
||||
hits = hits.concat(content.hits);
|
||||
});
|
||||
|
||||
browser.on('end', function onEnd() {
|
||||
const _message = `We got ${hits.length} hits`
|
||||
});
|
||||
|
||||
browser.on('error', function onError(err) {
|
||||
throw err;
|
||||
});
|
||||
|
||||
browser.stop();
|
||||
|
||||
index.browse("", {
|
||||
advancedSyntax: false,
|
||||
attributesToRetrieve: ['dogs']
|
||||
});
|
||||
client.copyIndex('from', 'to', ['settings']).then(()=>{});
|
||||
client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {});
|
||||
|
||||
Vendored
+145
-101
@@ -1,11 +1,14 @@
|
||||
// Type definitions for algoliasearch-client-js 3.27.0
|
||||
// Type definitions for algoliasearch-client-js 3.30.0
|
||||
// Project: https://github.com/algolia/algoliasearch-client-js
|
||||
// Definitions by: Baptiste Coquelle <https://github.com/cbaptiste>
|
||||
// Haroen Viaene <https://github.com/haroenv>
|
||||
// Aurélien Hervé <https://github.com/aherve>
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Kai Eichinger <https://github.com/keichinger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
||||
|
||||
declare namespace algoliasearch {
|
||||
/**
|
||||
@@ -611,6 +614,11 @@ declare namespace algoliasearch {
|
||||
options: SearchForFacetValues.Parameters,
|
||||
cb: (err: Error, res: SearchForFacetValues.Response) => void
|
||||
): void;
|
||||
/**
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
*/
|
||||
browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void;
|
||||
/**
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
@@ -620,7 +628,7 @@ declare namespace algoliasearch {
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
*/
|
||||
browse(query: string): Promise<BrowseResponse>;
|
||||
browse(query: string, parameters?: BrowseParameters): Promise<BrowseResponse>;
|
||||
/**
|
||||
* Browse an index from a cursor
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
@@ -638,7 +646,7 @@ declare namespace algoliasearch {
|
||||
* Browse an entire index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
*/
|
||||
browseAll(): Promise<Response>;
|
||||
browseAll(query?: string, parameters?: BrowseParameters): Browser;
|
||||
/**
|
||||
* Clear an index content
|
||||
* https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex
|
||||
@@ -966,6 +974,22 @@ declare namespace algoliasearch {
|
||||
query: string;
|
||||
processingTimeMS: number;
|
||||
}
|
||||
type BrowseParameters = Omit<
|
||||
QueryParameters,
|
||||
| "typoTolerance"
|
||||
| "distinct"
|
||||
| "facets"
|
||||
| "getRankingInfo"
|
||||
| "attributesToHighlight"
|
||||
| "attributesToSnippet"
|
||||
>
|
||||
interface Browser {
|
||||
on(type: "error", cb: (err: Error) => void): void
|
||||
on(type: "end", cb: () => void): void
|
||||
on(type: "stop", cb: () => void): void
|
||||
on(type: "result", cb: (content: BrowseResponse) => void): void
|
||||
stop(): void
|
||||
}
|
||||
/**
|
||||
* Describes a synonym object
|
||||
*/
|
||||
@@ -1099,120 +1123,121 @@ declare namespace algoliasearch {
|
||||
userToken?: string;
|
||||
}
|
||||
interface QueryParameters {
|
||||
/**
|
||||
* Query string used to perform the search
|
||||
* default: ''
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/query/
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Filter the query with numeric, facet or/and tag filters
|
||||
* default: ""
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/filters/
|
||||
*/
|
||||
filters?: string;
|
||||
/**
|
||||
* A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer.
|
||||
* default: *
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/
|
||||
*/
|
||||
attributesToRetrieve?: string[];
|
||||
/**
|
||||
* List of attributes you want to use for textual search
|
||||
* default: attributeToIndex
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/
|
||||
*/
|
||||
restrictSearchableAttributes?: string[];
|
||||
/**
|
||||
* You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/facets/
|
||||
*/
|
||||
facets?: string[];
|
||||
/**
|
||||
* Query string used to perform the search
|
||||
* default: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#query
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Filter the query with numeric, facet or/and tag filters
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#filters
|
||||
*/
|
||||
filters?: string;
|
||||
/**
|
||||
* A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer.
|
||||
* default: *
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestoretrieve
|
||||
*/
|
||||
attributesToRetrieve?: string[];
|
||||
/**
|
||||
* List of attributes you want to use for textual search
|
||||
* default: attributeToIndex
|
||||
* https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes
|
||||
*/
|
||||
restrictSearchableAttributes?: string[];
|
||||
/**
|
||||
* You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#facets
|
||||
*/
|
||||
facets?: string | string[];
|
||||
/**
|
||||
* Force faceting to be applied after de-duplication (via the Distinct setting).
|
||||
* When using the distinct setting in combination with faceting, facet counts may be higher than expected.
|
||||
* This is because the engine, by default, computes faceting before applying de-duplication (distinct).
|
||||
* When using the distinct setting in combination with faceting, facet counts may be higher than expected.
|
||||
* This is because the engine, by default, computes faceting before applying de-duplication (distinct).
|
||||
* When facetingAfterDistinct is set to true, the engine calculates faceting after the de-duplication has been applied.
|
||||
* default ""
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/
|
||||
*/
|
||||
facetingAfterDistinct?: boolean;
|
||||
/**
|
||||
* Limit the number of facet values returned for each facet.
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet
|
||||
* default: 100
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/
|
||||
*/
|
||||
maxValuesPerFacet?: number;
|
||||
/**
|
||||
* Default list of attributes to highlight. If set to null, all indexed attributes are highlighted.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestohighlight
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/
|
||||
*/
|
||||
attributesToHighlight?: string[];
|
||||
/**
|
||||
* Default list of attributes to snippet alongside the number of words to return
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestosnippet
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/
|
||||
*/
|
||||
attributesToSnippet?: string[];
|
||||
/**
|
||||
* Specify the string that is inserted before the highlighted parts in the query result
|
||||
* default: <em>
|
||||
* https://github.com/algolia/algoliasearch-client-js#highlightpretag
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/
|
||||
*/
|
||||
highlightPreTag?: string;
|
||||
/**
|
||||
* Specify the string that is inserted after the highlighted parts in the query result
|
||||
* default: </em>
|
||||
* https://github.com/algolia/algoliasearch-client-js#highlightposttag
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/
|
||||
*/
|
||||
highlightPostTag?: string;
|
||||
/**
|
||||
* String used as an ellipsis indicator when a snippet is truncated.
|
||||
* default: …
|
||||
* https://github.com/algolia/algoliasearch-client-js#snippetellipsistext
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/
|
||||
*/
|
||||
snippetEllipsisText?: string;
|
||||
/**
|
||||
* If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/
|
||||
*/
|
||||
restrictHighlightAndSnippetArrays?: boolean;
|
||||
/**
|
||||
* Pagination parameter used to select the number of hits per page
|
||||
* default: 20
|
||||
* https://github.com/algolia/algoliasearch-client-js#hitsperpage
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/
|
||||
*/
|
||||
hitsPerPage?: number;
|
||||
/**
|
||||
* Pagination parameter used to select the page to retrieve.
|
||||
* default: 0
|
||||
* https://github.com/algolia/algoliasearch-client-js#page
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/page/
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* Offset of the first hit to return
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#offset
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/offset/
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* Number of hits to return.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#length
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/length/
|
||||
*/
|
||||
length?: number;
|
||||
/**
|
||||
* The minimum number of characters needed to accept one typo.
|
||||
* default: 4
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/
|
||||
*/
|
||||
minWordSizefor1Typo?: number;
|
||||
/**
|
||||
* The minimum number of characters needed to accept two typo.
|
||||
* fault: 8
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/
|
||||
*/
|
||||
minWordSizefor2Typos?: number;
|
||||
/**
|
||||
@@ -1222,62 +1247,62 @@ declare namespace algoliasearch {
|
||||
* 'false' The typo tolerance is disabled. All results with typos will be hidden.
|
||||
* 'min' Only keep results with the minimum number of typos
|
||||
* 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos.
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/
|
||||
*/
|
||||
typoTolerance?: boolean;
|
||||
/**
|
||||
* If set to false, disables typo tolerance on numeric tokens (numbers).
|
||||
* default:
|
||||
* https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/
|
||||
*/
|
||||
allowTyposOnNumericTokens?: boolean;
|
||||
/**
|
||||
* If set to true, plural won't be considered as a typo
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#ignoreplurals
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/
|
||||
*/
|
||||
ignorePlurals?: boolean;
|
||||
/**
|
||||
* List of attributes on which you want to disable typo tolerance
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/
|
||||
*/
|
||||
disableTypoToleranceOnAttributes?: string;
|
||||
disableTypoToleranceOnAttributes?: string[];
|
||||
/**
|
||||
* Search for entries around a given location
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundlatlng
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/
|
||||
*/
|
||||
aroundLatLng?: string;
|
||||
/**
|
||||
* Search for entries around a given latitude/longitude automatically computed from user IP address.
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/
|
||||
*/
|
||||
aroundLatLngViaIP?: string;
|
||||
/**
|
||||
* Control the radius associated with a geo search. Defined in meters.
|
||||
* default: null
|
||||
* You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundradius
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/
|
||||
*/
|
||||
aroundRadius?: number | 'all';
|
||||
/**
|
||||
* Control the precision of a geo search
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundprecision
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/
|
||||
*/
|
||||
aroundPrecision?: number;
|
||||
/**
|
||||
* Define the minimum radius used for a geo search when aroundRadius is not set.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#minimumaroundradius
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/
|
||||
*/
|
||||
minimumAroundRadius?: number;
|
||||
/**
|
||||
* Search entries inside a given area defined by the two extreme points of a rectangle
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#insideboundingbox
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/
|
||||
*/
|
||||
insideBoundingBox?: number[][];
|
||||
/**
|
||||
@@ -1286,13 +1311,13 @@ declare namespace algoliasearch {
|
||||
* 'prefixAll' All query words are interpreted as prefixes. This option is not recommended.
|
||||
* 'prefixLast' Only the last word is interpreted as a prefix (default behavior).
|
||||
* 'prefixNone' No query word is interpreted as a prefix. This option is not recommended.
|
||||
* https://github.com/algolia/algoliasearch-client-js#querytype
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/queryType/
|
||||
*/
|
||||
queryType?: any;
|
||||
queryType?: "prefixAll"|"prefixLast"|"prefixNone";
|
||||
/**
|
||||
* Search entries inside a given area defined by a set of points
|
||||
* defauly: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#insidepolygon
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/
|
||||
*/
|
||||
insidePolygon?: number[][];
|
||||
/**
|
||||
@@ -1302,19 +1327,19 @@ declare namespace algoliasearch {
|
||||
* 'firstWords' When a query does not return any results, the first word will be added as optional
|
||||
* 'allOptional' When a query does not return any results, a second trial will be made with all words as optional
|
||||
* 'none' No specific processing is done when a query does not return any results
|
||||
* https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/
|
||||
*/
|
||||
removeWordsIfNoResults?: string;
|
||||
removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional";
|
||||
/**
|
||||
* Enables the advanced query syntax
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#advancedsyntax
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/
|
||||
*/
|
||||
advancedSyntax?: boolean;
|
||||
/**
|
||||
* A string that contains the comma separated list of words that should be considered as optional when found in the query
|
||||
* default: []
|
||||
* https://github.com/algolia/algoliasearch-client-js#optionalwords
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/
|
||||
*/
|
||||
optionalWords?: string[];
|
||||
/**
|
||||
@@ -1322,13 +1347,13 @@ declare namespace algoliasearch {
|
||||
* default: false
|
||||
* true|false: enable or disable stop words for all 41 supported languages; or
|
||||
* a list of language ISO codes (as a comma-separated string) for which stop words should be enable
|
||||
* https://github.com/algolia/algoliasearch-client-js#removestopwords
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/
|
||||
*/
|
||||
removeStopWords?: string[];
|
||||
removeStopWords?: boolean|string[];
|
||||
/**
|
||||
* List of attributes on which you want to disable the computation of exact criteria
|
||||
* default: []
|
||||
* https://github.com/algolia/algoliasearch-client-js#disableexactonattributes
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/
|
||||
*/
|
||||
disableExactOnAttributes?: string[];
|
||||
/**
|
||||
@@ -1337,81 +1362,90 @@ declare namespace algoliasearch {
|
||||
* 'none': no exact on single word query
|
||||
* 'word': exact set to 1 if the query word is found in the record
|
||||
* 'attribute': exact set to 1 if there is an attribute containing a string equals to the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/
|
||||
*/
|
||||
exactOnSingleWordQuery?: string;
|
||||
exactOnSingleWordQuery?: "attribute"|"none"|"word";
|
||||
/**
|
||||
* Specify the list of approximation that should be considered as an exact match in the ranking formula
|
||||
* default: ['ignorePlurals', 'singleWordSynonym']
|
||||
* 'ignorePlurals': alternative words added by the ignorePlurals feature
|
||||
* 'singleWordSynonym': single-word synonym (For example "NY" = "NYC")
|
||||
* 'multiWordsSynonym': multiple-words synonym
|
||||
* https://github.com/algolia/algoliasearch-client-js#alternativesasexact
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/
|
||||
*/
|
||||
alternativesAsExact?: any;
|
||||
alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">;
|
||||
/**
|
||||
* If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set.
|
||||
* https://github.com/algolia/algoliasearch-client-js#distinct
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/distinct/
|
||||
*/
|
||||
distinct?: any;
|
||||
distinct?: number|boolean;
|
||||
/**
|
||||
* If set to true, the result hits will contain ranking information in the _rankingInfo attribute.
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#getrankinginfo
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/
|
||||
*/
|
||||
getRankingInfo?: boolean;
|
||||
/**
|
||||
* @deprecated Use `numericAttributesForFiltering` instead
|
||||
* All numerical attributes are automatically indexed as numerical filters
|
||||
* default: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#numericattributestoindex
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/
|
||||
*/
|
||||
numericAttributesToIndex?: string[];
|
||||
/**
|
||||
* All numerical attributes are automatically indexed as numerical filters
|
||||
* default: ''
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/
|
||||
*/
|
||||
numericAttributesForFiltering?: string[];
|
||||
/**
|
||||
* @deprecated please use filters instead
|
||||
* A string that contains the comma separated list of numeric filters you want to apply.
|
||||
* https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/
|
||||
*/
|
||||
numericFilters?: string[];
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* Filter the query by a set of tags.
|
||||
* https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated
|
||||
* Default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/
|
||||
*/
|
||||
tagFilters?: string;
|
||||
tagFilters?: string[];
|
||||
/**
|
||||
* @deprecated
|
||||
* Filter the query by a set of facets.
|
||||
* https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated
|
||||
* Default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/
|
||||
*/
|
||||
facetFilters?: string | string[]
|
||||
facetFilters?: string[]|string[][];
|
||||
/**
|
||||
* If set to false, this query will not be taken into account in the analytics feature.
|
||||
* default true
|
||||
* https://github.com/algolia/algoliasearch-client-js#analytics
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/analytics/
|
||||
*/
|
||||
analytics?: boolean;
|
||||
/**
|
||||
* If set, tag your query with the specified identifiers
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#analyticstags
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/
|
||||
*/
|
||||
analyticsTags?: string[];
|
||||
/**
|
||||
* If set to false, the search will not use the synonyms defined for the targeted index.
|
||||
* default: true
|
||||
* https://github.com/algolia/algoliasearch-client-js#synonyms
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/synonyms/
|
||||
*/
|
||||
synonyms?: boolean;
|
||||
/**
|
||||
* If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result.
|
||||
* default: true
|
||||
* https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/
|
||||
*/
|
||||
replaceSynonymsInHighlight?: boolean;
|
||||
/**
|
||||
* Configure the precision of the proximity ranking criterion
|
||||
* default: 1
|
||||
* https://github.com/algolia/algoliasearch-client-js#minproximity
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minProximity/
|
||||
*/
|
||||
minProximity?: number;
|
||||
|
||||
@@ -1464,7 +1498,7 @@ declare namespace algoliasearch {
|
||||
interface Task {
|
||||
taskID: number;
|
||||
createdAt: string;
|
||||
objectID?: string;
|
||||
objectID?: string;
|
||||
}
|
||||
|
||||
interface TaskStatus {
|
||||
@@ -1747,42 +1781,42 @@ declare namespace algoliasearch {
|
||||
interface Response {
|
||||
/**
|
||||
* Contains all the hits matching the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hits: any[];
|
||||
/**
|
||||
* Current page
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Number of total hits matching the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
nbHits: number;
|
||||
/**
|
||||
* Number of pages
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
nbPages: number;
|
||||
/**
|
||||
* Number of hits per pages
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hitsPerPage: number;
|
||||
/**
|
||||
* Engine processing time (excluding network transfer)
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
processingTimeMS: number;
|
||||
/**
|
||||
* Query used to perform the search
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* GET parameters used to perform the search
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
params: string;
|
||||
facets?: {
|
||||
@@ -1796,6 +1830,16 @@ declare namespace algoliasearch {
|
||||
sum: number,
|
||||
};
|
||||
};
|
||||
/**
|
||||
* The index name is only set when searching multiple indices.
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response
|
||||
*/
|
||||
index?: string;
|
||||
/**
|
||||
* The cursor is only set when browsing the index.
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/browse/
|
||||
*/
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
|
||||
Vendored
+110
-75
@@ -1,12 +1,15 @@
|
||||
// Type definitions for algoliasearch-client-js 3.27.0
|
||||
// Type definitions for algoliasearch-client-js 3.30.0
|
||||
// Project: https://github.com/algolia/algoliasearch-client-js
|
||||
// Definitions by: Baptiste Coquelle <https://github.com/cbaptiste>
|
||||
// Haroen Viaene <https://github.com/haroenv>
|
||||
// Aurélien Hervé <https://github.com/aherve>
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Claas Brüggemann <https://github.com/ClaasBrueggemann>
|
||||
// Kai Eichinger <https://github.com/keichinger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
||||
|
||||
declare namespace algoliasearch {
|
||||
/**
|
||||
@@ -130,6 +133,11 @@ declare namespace algoliasearch {
|
||||
options: SearchForFacetValues.Parameters,
|
||||
cb: (err: Error, res: SearchForFacetValues.Response) => void
|
||||
): void;
|
||||
/**
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
*/
|
||||
browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void;
|
||||
/**
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
@@ -139,7 +147,7 @@ declare namespace algoliasearch {
|
||||
* Browse an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
*/
|
||||
browse(query: string): Promise<BrowseResponse>;
|
||||
browse(query: string, parameters?: BrowseParameters): Promise<BrowseResponse>;
|
||||
/**
|
||||
* Browse an index from a cursor
|
||||
* https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse
|
||||
@@ -194,114 +202,122 @@ declare namespace algoliasearch {
|
||||
query: string;
|
||||
processingTimeMS: number;
|
||||
}
|
||||
|
||||
type BrowseParameters = Omit<
|
||||
QueryParameters,
|
||||
| "typoTolerance"
|
||||
| "distinct"
|
||||
| "facets"
|
||||
| "getRankingInfo"
|
||||
| "attributesToHighlight"
|
||||
| "attributesToSnippet"
|
||||
>
|
||||
interface QueryParameters {
|
||||
/**
|
||||
* Query string used to perform the search
|
||||
* default: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#query
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/query/
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Filter the query with numeric, facet or/and tag filters
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#filters
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/filters/
|
||||
*/
|
||||
filters?: string;
|
||||
/**
|
||||
* A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer.
|
||||
* default: *
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestoretrieve
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/
|
||||
*/
|
||||
attributesToRetrieve?: string[];
|
||||
/**
|
||||
* List of attributes you want to use for textual search
|
||||
* default: attributeToIndex
|
||||
* https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/
|
||||
*/
|
||||
restrictSearchableAttributes?: string[];
|
||||
/**
|
||||
* You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#facets
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/facets/
|
||||
*/
|
||||
facets?: string;
|
||||
facets?: string[];
|
||||
/**
|
||||
* Limit the number of facet values returned for each facet.
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet
|
||||
* default: 100
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/
|
||||
*/
|
||||
maxValuesPerFacet?: number;
|
||||
/**
|
||||
* Default list of attributes to highlight. If set to null, all indexed attributes are highlighted.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestohighlight
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/
|
||||
*/
|
||||
attributesToHighlight?: string[];
|
||||
/**
|
||||
* Default list of attributes to snippet alongside the number of words to return
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#attributestosnippet
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/
|
||||
*/
|
||||
attributesToSnippet?: string[];
|
||||
/**
|
||||
* Specify the string that is inserted before the highlighted parts in the query result
|
||||
* default: <em>
|
||||
* https://github.com/algolia/algoliasearch-client-js#highlightpretag
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/
|
||||
*/
|
||||
highlightPreTag?: string;
|
||||
/**
|
||||
* Specify the string that is inserted after the highlighted parts in the query result
|
||||
* default: </em>
|
||||
* https://github.com/algolia/algoliasearch-client-js#highlightposttag
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/
|
||||
*/
|
||||
highlightPostTag?: string;
|
||||
/**
|
||||
* String used as an ellipsis indicator when a snippet is truncated.
|
||||
* default: …
|
||||
* https://github.com/algolia/algoliasearch-client-js#snippetellipsistext
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/
|
||||
*/
|
||||
snippetEllipsisText?: string;
|
||||
/**
|
||||
* If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/
|
||||
*/
|
||||
restrictHighlightAndSnippetArrays?: boolean;
|
||||
/**
|
||||
* Pagination parameter used to select the number of hits per page
|
||||
* default: 20
|
||||
* https://github.com/algolia/algoliasearch-client-js#hitsperpage
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/
|
||||
*/
|
||||
hitsPerPage?: number;
|
||||
/**
|
||||
* Pagination parameter used to select the page to retrieve.
|
||||
* default: 0
|
||||
* https://github.com/algolia/algoliasearch-client-js#page
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/page/
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* Offset of the first hit to return
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#offset
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/offset/
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* Number of hits to return.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#length
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/length/
|
||||
*/
|
||||
length?: number;
|
||||
/**
|
||||
* The minimum number of characters needed to accept one typo.
|
||||
* default: 4
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/
|
||||
*/
|
||||
minWordSizefor1Typo?: number;
|
||||
/**
|
||||
* The minimum number of characters needed to accept two typo.
|
||||
* fault: 8
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/
|
||||
*/
|
||||
minWordSizefor2Typos?: number;
|
||||
/**
|
||||
@@ -311,62 +327,62 @@ declare namespace algoliasearch {
|
||||
* 'false' The typo tolerance is disabled. All results with typos will be hidden.
|
||||
* 'min' Only keep results with the minimum number of typos
|
||||
* 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos.
|
||||
* https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/
|
||||
*/
|
||||
typoTolerance?: boolean;
|
||||
/**
|
||||
* If set to false, disables typo tolerance on numeric tokens (numbers).
|
||||
* default:
|
||||
* https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/
|
||||
*/
|
||||
allowTyposOnNumericTokens?: boolean;
|
||||
/**
|
||||
* If set to true, plural won't be considered as a typo
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#ignoreplurals
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/
|
||||
*/
|
||||
ignorePlurals?: boolean;
|
||||
/**
|
||||
* List of attributes on which you want to disable typo tolerance
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/
|
||||
*/
|
||||
disableTypoToleranceOnAttributes?: string;
|
||||
disableTypoToleranceOnAttributes?: string[];
|
||||
/**
|
||||
* Search for entries around a given location
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundlatlng
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/
|
||||
*/
|
||||
aroundLatLng?: string;
|
||||
/**
|
||||
* Search for entries around a given latitude/longitude automatically computed from user IP address.
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/
|
||||
*/
|
||||
aroundLatLngViaIP?: string;
|
||||
/**
|
||||
* Control the radius associated with a geo search. Defined in meters.
|
||||
* default: null
|
||||
* You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundradius
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/
|
||||
*/
|
||||
aroundRadius?: number | 'all';
|
||||
/**
|
||||
* Control the precision of a geo search
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundprecision
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/
|
||||
*/
|
||||
aroundPrecision?: number;
|
||||
/**
|
||||
* Define the minimum radius used for a geo search when aroundRadius is not set.
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#minimumaroundradius
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/
|
||||
*/
|
||||
minimumAroundRadius?: number;
|
||||
/**
|
||||
* Search entries inside a given area defined by the two extreme points of a rectangle
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#insideboundingbox
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/
|
||||
*/
|
||||
insideBoundingBox?: number[][];
|
||||
/**
|
||||
@@ -375,13 +391,13 @@ declare namespace algoliasearch {
|
||||
* 'prefixAll' All query words are interpreted as prefixes. This option is not recommended.
|
||||
* 'prefixLast' Only the last word is interpreted as a prefix (default behavior).
|
||||
* 'prefixNone' No query word is interpreted as a prefix. This option is not recommended.
|
||||
* https://github.com/algolia/algoliasearch-client-js#querytype
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/queryType/
|
||||
*/
|
||||
queryType?: any;
|
||||
queryType?: "prefixAll"|"prefixLast"|"prefixNone";
|
||||
/**
|
||||
* Search entries inside a given area defined by a set of points
|
||||
* defauly: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#insidepolygon
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/
|
||||
*/
|
||||
insidePolygon?: number[][];
|
||||
/**
|
||||
@@ -391,19 +407,19 @@ declare namespace algoliasearch {
|
||||
* 'firstWords' When a query does not return any results, the first word will be added as optional
|
||||
* 'allOptional' When a query does not return any results, a second trial will be made with all words as optional
|
||||
* 'none' No specific processing is done when a query does not return any results
|
||||
* https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/
|
||||
*/
|
||||
removeWordsIfNoResults?: string;
|
||||
removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional";
|
||||
/**
|
||||
* Enables the advanced query syntax
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#advancedsyntax
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/
|
||||
*/
|
||||
advancedSyntax?: boolean;
|
||||
/**
|
||||
* A string that contains the comma separated list of words that should be considered as optional when found in the query
|
||||
* default: []
|
||||
* https://github.com/algolia/algoliasearch-client-js#optionalwords
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/
|
||||
*/
|
||||
optionalWords?: string[];
|
||||
/**
|
||||
@@ -411,13 +427,13 @@ declare namespace algoliasearch {
|
||||
* default: false
|
||||
* true|false: enable or disable stop words for all 41 supported languages; or
|
||||
* a list of language ISO codes (as a comma-separated string) for which stop words should be enable
|
||||
* https://github.com/algolia/algoliasearch-client-js#removestopwords
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/
|
||||
*/
|
||||
removeStopWords?: string[];
|
||||
removeStopWords?: boolean|string[];
|
||||
/**
|
||||
* List of attributes on which you want to disable the computation of exact criteria
|
||||
* default: []
|
||||
* https://github.com/algolia/algoliasearch-client-js#disableexactonattributes
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/
|
||||
*/
|
||||
disableExactOnAttributes?: string[];
|
||||
/**
|
||||
@@ -426,81 +442,90 @@ declare namespace algoliasearch {
|
||||
* 'none': no exact on single word query
|
||||
* 'word': exact set to 1 if the query word is found in the record
|
||||
* 'attribute': exact set to 1 if there is an attribute containing a string equals to the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/
|
||||
*/
|
||||
exactOnSingleWordQuery?: string;
|
||||
exactOnSingleWordQuery?: "attribute"|"none"|"word";
|
||||
/**
|
||||
* Specify the list of approximation that should be considered as an exact match in the ranking formula
|
||||
* default: ['ignorePlurals', 'singleWordSynonym']
|
||||
* 'ignorePlurals': alternative words added by the ignorePlurals feature
|
||||
* 'singleWordSynonym': single-word synonym (For example "NY" = "NYC")
|
||||
* 'multiWordsSynonym': multiple-words synonym
|
||||
* https://github.com/algolia/algoliasearch-client-js#alternativesasexact
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/
|
||||
*/
|
||||
alternativesAsExact?: any;
|
||||
alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">;
|
||||
/**
|
||||
* If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set.
|
||||
* https://github.com/algolia/algoliasearch-client-js#distinct
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/distinct/
|
||||
*/
|
||||
distinct?: any;
|
||||
distinct?: number|boolean;
|
||||
/**
|
||||
* If set to true, the result hits will contain ranking information in the _rankingInfo attribute.
|
||||
* default: false
|
||||
* https://github.com/algolia/algoliasearch-client-js#getrankinginfo
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/
|
||||
*/
|
||||
getRankingInfo?: boolean;
|
||||
/**
|
||||
* @deprecated Use `numericAttributesForFiltering` instead
|
||||
* All numerical attributes are automatically indexed as numerical filters
|
||||
* default: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#numericattributestoindex
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/
|
||||
*/
|
||||
numericAttributesToIndex?: string[];
|
||||
/**
|
||||
* All numerical attributes are automatically indexed as numerical filters
|
||||
* default: ''
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/
|
||||
*/
|
||||
numericAttributesForFiltering?: string[];
|
||||
/**
|
||||
* @deprecated please use filters instead
|
||||
* A string that contains the comma separated list of numeric filters you want to apply.
|
||||
* https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/
|
||||
*/
|
||||
numericFilters?: string[];
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* Filter the query by a set of tags.
|
||||
* https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated
|
||||
* Default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/
|
||||
*/
|
||||
tagFilters?: string;
|
||||
tagFilters?: string[];
|
||||
/**
|
||||
* @deprecated
|
||||
* Filter the query by a set of facets.
|
||||
* https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated
|
||||
* Default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/
|
||||
*/
|
||||
facetFilters?: string;
|
||||
facetFilters?: string[]|string[][];
|
||||
/**
|
||||
* If set to false, this query will not be taken into account in the analytics feature.
|
||||
* default true
|
||||
* https://github.com/algolia/algoliasearch-client-js#analytics
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/analytics/
|
||||
*/
|
||||
analytics?: boolean;
|
||||
/**
|
||||
* If set, tag your query with the specified identifiers
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#analyticstags
|
||||
* default: []
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/
|
||||
*/
|
||||
analyticsTags?: string[];
|
||||
/**
|
||||
* If set to false, the search will not use the synonyms defined for the targeted index.
|
||||
* default: true
|
||||
* https://github.com/algolia/algoliasearch-client-js#synonyms
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/synonyms/
|
||||
*/
|
||||
synonyms?: boolean;
|
||||
/**
|
||||
* If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result.
|
||||
* default: true
|
||||
* https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/
|
||||
*/
|
||||
replaceSynonymsInHighlight?: boolean;
|
||||
/**
|
||||
* Configure the precision of the proximity ranking criterion
|
||||
* default: 1
|
||||
* https://github.com/algolia/algoliasearch-client-js#minproximity
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/minProximity/
|
||||
*/
|
||||
minProximity?: number;
|
||||
|
||||
@@ -530,42 +555,42 @@ declare namespace algoliasearch {
|
||||
interface Response {
|
||||
/**
|
||||
* Contains all the hits matching the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hits: any[];
|
||||
/**
|
||||
* Current page
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Number of total hits matching the query
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
nbHits: number;
|
||||
/**
|
||||
* Number of pages
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
nbPages: number;
|
||||
/**
|
||||
* Number of hits per pages
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hitsPerPage: number;
|
||||
/**
|
||||
* Engine processing time (excluding network transfer)
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
processingTimeMS: number;
|
||||
/**
|
||||
* Query used to perform the search
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* GET parameters used to perform the search
|
||||
* https://github.com/algolia/algoliasearch-client-js#response-format
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
params: string;
|
||||
facets?: {
|
||||
@@ -579,6 +604,16 @@ declare namespace algoliasearch {
|
||||
sum: number,
|
||||
};
|
||||
};
|
||||
/**
|
||||
* The index name is only set when searching multiple indices.
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response
|
||||
*/
|
||||
index?: string;
|
||||
/**
|
||||
* The cursor is only set when browsing the index.
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/browse/
|
||||
*/
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+3265
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ali-app-tests.ts"
|
||||
],
|
||||
"exclude": [
|
||||
".prettierrc"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-mergeable-namespace": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
Vendored
+3
-3
@@ -8,7 +8,7 @@
|
||||
|
||||
import * as Promise from 'bluebird';
|
||||
import * as events from 'events';
|
||||
import { Replies, Options, Message } from './properties';
|
||||
import { Replies, Options, Message, GetMessage, ConsumeMessage } from './properties';
|
||||
export * from './properties';
|
||||
|
||||
export interface Connection extends events.EventEmitter {
|
||||
@@ -40,10 +40,10 @@ export interface Channel extends events.EventEmitter {
|
||||
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean;
|
||||
sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean;
|
||||
|
||||
consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume): Promise<Replies.Consume>;
|
||||
consume(queue: string, onMessage: (msg: ConsumeMessage | null) => any, options?: Options.Consume): Promise<Replies.Consume>;
|
||||
|
||||
cancel(consumerTag: string): Promise<Replies.Empty>;
|
||||
get(queue: string, options?: Options.Get): Promise<Message | false>;
|
||||
get(queue: string, options?: Options.Get): Promise<GetMessage | false>;
|
||||
|
||||
ack(message: Message, allUpTo?: boolean): void;
|
||||
ackAll(): void;
|
||||
|
||||
Vendored
+22
-2
@@ -145,12 +145,32 @@ export interface Message {
|
||||
properties: MessageProperties;
|
||||
}
|
||||
|
||||
export interface MessageFields {
|
||||
export interface GetMessage extends Message {
|
||||
fields: GetMessageFields;
|
||||
}
|
||||
|
||||
export interface ConsumeMessage extends Message {
|
||||
fields: ConsumeMessageFields;
|
||||
}
|
||||
|
||||
export interface CommonMessageFields {
|
||||
deliveryTag: number;
|
||||
redelivered: boolean;
|
||||
exchange: string;
|
||||
routingKey: string;
|
||||
messageCount: string;
|
||||
}
|
||||
|
||||
export interface MessageFields extends CommonMessageFields {
|
||||
messageCount?: number;
|
||||
consumerTag?: string;
|
||||
}
|
||||
|
||||
export interface GetMessageFields extends CommonMessageFields {
|
||||
messageCount: number;
|
||||
}
|
||||
|
||||
export interface ConsumeMessageFields extends CommonMessageFields {
|
||||
deliveryTag: number;
|
||||
}
|
||||
|
||||
export interface MessageProperties {
|
||||
|
||||
Vendored
+1
@@ -340,6 +340,7 @@ declare module 'angular' {
|
||||
|
||||
interface IMenuService {
|
||||
hide(response?: any, options?: any): IPromise<any>;
|
||||
open(event?: MouseEvent): void;
|
||||
}
|
||||
|
||||
interface IColorPalette {
|
||||
|
||||
@@ -16,6 +16,9 @@ interface SortLogInfo {
|
||||
Text: string;
|
||||
}
|
||||
|
||||
// Ensure that the jQuery-ui defined `sortable()` method is not overwritten
|
||||
jQuery().sortable(); // $ExpectType JQuery<HTMLElement>
|
||||
|
||||
myApp.controller('sortableController', function ($scope: MySortableControllerScope) {
|
||||
$scope.sortableOptions = {
|
||||
activate: function(e, ui) {
|
||||
@@ -84,6 +87,7 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco
|
||||
update: function(e, ui) {
|
||||
var jQueryEventObject: JQueryEventObject = e;
|
||||
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
|
||||
ui.item.sortable; // $ExpectType UISortableProperties<SortableModelInfo>
|
||||
var voidcanceled: void = ui.item.sortable.cancel();
|
||||
var isCanceled: Boolean = ui.item.sortable.isCanceled();
|
||||
var isCustomHelperUsed: Boolean =ui.item.sortable.isCustomHelperUsed();
|
||||
|
||||
Vendored
+7
-3
@@ -2,12 +2,16 @@
|
||||
// Project: https://github.com/angular-ui/ui-sortable
|
||||
// Definitions by: Thodoris Greasidis <https://github.com/thgreasi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="angular" />
|
||||
/// <reference types="jqueryui" />
|
||||
|
||||
import * as ng from 'angular';
|
||||
|
||||
// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
|
||||
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
|
||||
declare module 'angular' {
|
||||
export namespace ui {
|
||||
|
||||
@@ -79,11 +83,11 @@ declare module 'angular' {
|
||||
isCustomHelperUsed(): Boolean;
|
||||
}
|
||||
|
||||
interface UISortableUIItem<T> extends ng.IAugmentedJQuery {
|
||||
interface UISortableUIItem<T> extends Omit<ng.IAugmentedJQuery, 'sortable'> {
|
||||
sortable: UISortableProperties<T>;
|
||||
}
|
||||
|
||||
interface UISortableUIParams<T> extends SortableUIParams {
|
||||
interface UISortableUIParams<T> extends Omit<SortableUIParams, 'item'> {
|
||||
item: UISortableUIItem<T>;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+6
-6
@@ -4,7 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
type FunctionBasedParamter = (element: HTMLElement, index: number, length: number) => number;
|
||||
type FunctionBasedParameter = (element: HTMLElement, index: number, length: number) => number;
|
||||
type AnimeCallbackFunction = (anim: anime.AnimeInstance) => void;
|
||||
// Allowing null is necessary because DOM queries may not return anything.
|
||||
type AnimeTarget = string | object | HTMLElement | SVGElement | NodeList | null;
|
||||
@@ -55,10 +55,10 @@ declare namespace anime {
|
||||
interface AnimeAnimParams {
|
||||
targets: AnimeTarget | ReadonlyArray<AnimeTarget>;
|
||||
|
||||
duration?: number | FunctionBasedParamter;
|
||||
delay?: number | FunctionBasedParamter;
|
||||
elasticity?: number | FunctionBasedParamter;
|
||||
round?: number | boolean | FunctionBasedParamter;
|
||||
duration?: number | FunctionBasedParameter;
|
||||
delay?: number | FunctionBasedParameter;
|
||||
elasticity?: number | FunctionBasedParameter;
|
||||
round?: number | boolean | FunctionBasedParameter;
|
||||
|
||||
easing?: EasingOptions | string | ReadonlyArray<number>;
|
||||
|
||||
@@ -106,7 +106,7 @@ declare namespace anime {
|
||||
}
|
||||
|
||||
interface AnimeTimelineAnimParams extends AnimeAnimParams {
|
||||
offset: number | string | FunctionBasedParamter;
|
||||
offset: number | string | FunctionBasedParameter;
|
||||
}
|
||||
|
||||
interface AnimeTimelineInstance extends AnimeInstance {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import ansi = require('ansi');
|
||||
const cursor = ansi(process.stdout);
|
||||
|
||||
Object.keys({
|
||||
white: 37
|
||||
, black: 30
|
||||
, blue: 34
|
||||
, cyan: 36
|
||||
, green: 32
|
||||
, magenta: 35
|
||||
, red: 31
|
||||
, yellow: 33
|
||||
, grey: 90
|
||||
, brightBlack: 90
|
||||
, brightRed: 91
|
||||
, brightGreen: 92
|
||||
, brightYellow: 93
|
||||
, brightBlue: 94
|
||||
, brightMagenta: 95
|
||||
, brightCyan: 96
|
||||
, brightWhite: 97
|
||||
}).forEach((color) => {
|
||||
cursor[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
|
||||
});
|
||||
Vendored
+168
@@ -0,0 +1,168 @@
|
||||
// Type definitions for ansi 0.3
|
||||
// Project: https://www.npmjs.com/package/ansi
|
||||
// Definitions by: Gustavo6046 <https://github.com/Gustavo6046>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* References:
|
||||
*
|
||||
* - http://en.wikipedia.org/wiki/ANSI_escape_code
|
||||
* - http://www.termsys.demon.co.uk/vtansi.htm
|
||||
*
|
||||
*/
|
||||
|
||||
/// <reference types="node" />
|
||||
import { Stream } from "stream";
|
||||
|
||||
declare function ansi(stream: Stream, options?: any): ansi.Cursor;
|
||||
|
||||
declare namespace ansi {
|
||||
class Cursor {
|
||||
constructor(stream: Stream, options?: any);
|
||||
|
||||
/**
|
||||
* Helper function that calls `write()` on the underlying Stream.
|
||||
* Returns `this` instead of the write() return value to keep
|
||||
* the chaining going.
|
||||
*/
|
||||
write(data: string): Cursor;
|
||||
|
||||
/**
|
||||
* Buffer `write()` calls into memory.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
buffer(): Cursor;
|
||||
|
||||
/**
|
||||
* Write out the in-memory buffer.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
flush(): Cursor;
|
||||
|
||||
/**
|
||||
* Makes a beep sound!
|
||||
*/
|
||||
beep(): Cursor;
|
||||
|
||||
/**
|
||||
* Moves cursor to specific position
|
||||
*/
|
||||
goto(x?: number, y?: number): Cursor;
|
||||
|
||||
/**
|
||||
* Resets all ANSI formatting on the stream.
|
||||
*/
|
||||
reset(): Cursor;
|
||||
|
||||
/**
|
||||
* Sets the foreground color with the given RGB values.
|
||||
* The closest match out of the 216 colors is picked.
|
||||
*/
|
||||
rgb(r: number, g: number, b: number): Cursor;
|
||||
|
||||
/**
|
||||
* Accepts CSS color codes for use with ANSI escape codes.
|
||||
* For example: `#FF000` would be bright red.
|
||||
*/
|
||||
hex(color: string): Cursor;
|
||||
|
||||
up(): Cursor;
|
||||
down(): Cursor;
|
||||
forward(): Cursor;
|
||||
back(): Cursor;
|
||||
nextLine(): Cursor;
|
||||
previousLine(): Cursor;
|
||||
horizontalAbsolute(): Cursor;
|
||||
eraseData(): Cursor;
|
||||
eraseLine(): Cursor;
|
||||
scrollUp(): Cursor;
|
||||
scrollDown(): Cursor;
|
||||
savePosition(): Cursor;
|
||||
restorePosition(): Cursor;
|
||||
queryPosition(): Cursor;
|
||||
hide(): Cursor;
|
||||
show(): Cursor;
|
||||
|
||||
bold(): Cursor;
|
||||
italic(): Cursor;
|
||||
underline(): Cursor;
|
||||
inverse(): Cursor;
|
||||
resetbold(): Cursor;
|
||||
resetitalic(): Cursor;
|
||||
resetunderline(): Cursor;
|
||||
resetinverse(): Cursor;
|
||||
|
||||
white(): Cursor;
|
||||
black(): Cursor;
|
||||
blue(): Cursor;
|
||||
cyan(): Cursor;
|
||||
green(): Cursor;
|
||||
magenta(): Cursor;
|
||||
red(): Cursor;
|
||||
yellow(): Cursor;
|
||||
grey(): Cursor;
|
||||
brightBlack(): Cursor;
|
||||
brightRed(): Cursor;
|
||||
brightGreen(): Cursor;
|
||||
brightYellow(): Cursor;
|
||||
brightBlue(): Cursor;
|
||||
brightMagenta(): Cursor;
|
||||
brightCyan(): Cursor;
|
||||
brightWhite(): Cursor;
|
||||
}
|
||||
|
||||
/**
|
||||
* The `Colorer` class manages both the background and foreground colors.
|
||||
*/
|
||||
class Colorer {
|
||||
constructor(cursor: Cursor, base: string);
|
||||
|
||||
/**
|
||||
* Write an ANSI color code, ensuring that the same code doesn't get rewritten.
|
||||
*/
|
||||
_setColorCode(code: string): Colorer;
|
||||
|
||||
/**
|
||||
* Resets the color.
|
||||
*/
|
||||
reset(): Cursor;
|
||||
|
||||
/**
|
||||
* Sets the foreground color with the given RGB values.
|
||||
* The closest match out of the 216 colors is picked.
|
||||
*/
|
||||
rgb(r: number, g: number, b: number): Cursor;
|
||||
|
||||
/**
|
||||
* Accepts CSS color codes for use with ANSI escape codes.
|
||||
* For example: `#FF000` would be bright red.
|
||||
*/
|
||||
hex(color: string): Cursor;
|
||||
|
||||
white(): Cursor;
|
||||
black(): Cursor;
|
||||
blue(): Cursor;
|
||||
cyan(): Cursor;
|
||||
green(): Cursor;
|
||||
magenta(): Cursor;
|
||||
red(): Cursor;
|
||||
yellow(): Cursor;
|
||||
grey(): Cursor;
|
||||
brightBlack(): Cursor;
|
||||
brightRed(): Cursor;
|
||||
brightGreen(): Cursor;
|
||||
brightYellow(): Cursor;
|
||||
brightBlue(): Cursor;
|
||||
brightMagenta(): Cursor;
|
||||
brightCyan(): Cursor;
|
||||
brightWhite(): Cursor;
|
||||
}
|
||||
|
||||
interface Cursor {
|
||||
[key: string]: (...anything: any[]) => Cursor;
|
||||
}
|
||||
}
|
||||
|
||||
export = ansi;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ansi-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"noEmit": true,
|
||||
"types": [],
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ type FontFamily =
|
||||
| BaseCSSProperties['fontFamily']
|
||||
| CSS.FontFace;
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily' | 'transition' | 'animationName' > & {
|
||||
fontFamily?: FontFamily | FontFamily[];
|
||||
|
||||
Vendored
+3
@@ -145,6 +145,9 @@ declare namespace apostrophe {
|
||||
required?: boolean;
|
||||
options?: AposObject;
|
||||
choices?: SelectChoice[];
|
||||
widgetType?: string;
|
||||
titleField?: string;
|
||||
schema?: Field[];
|
||||
}
|
||||
|
||||
interface SelectChoice {
|
||||
|
||||
Vendored
+1
-1
@@ -1698,7 +1698,7 @@ declare module "@arangodb/crypto" {
|
||||
key: string | null,
|
||||
token: string,
|
||||
noVerify?: boolean
|
||||
): string | null;
|
||||
): object | null;
|
||||
function md5(message: string): string;
|
||||
function sha1(message: string): string;
|
||||
function sha224(message: string): string;
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
import art from 'ascii-art';
|
||||
|
||||
art.font('test', 'doom').toPromise();
|
||||
|
||||
art.font('my text', 'Doom', (rendered: string) => {
|
||||
rendered.big();
|
||||
});
|
||||
|
||||
art.font('my text', 'Doom', '', (rendered) => {
|
||||
rendered.big();
|
||||
});
|
||||
|
||||
art.artwork({
|
||||
artwork: 'textfiles.com/art/st-char.asc'
|
||||
}).lines(31, 45, (rendered: string) => {
|
||||
// cleanup non-unix terminators
|
||||
rendered = rendered.replace(/\r/g, '');
|
||||
art.image({
|
||||
filepath : '~/Images/earth_in_space.jpg',
|
||||
alphabet : 'ultra-wide'
|
||||
}).overlay(rendered, {
|
||||
x: 0,
|
||||
y: -1,
|
||||
style: 'red+blink',
|
||||
transparent: '&'
|
||||
}, (_final: any) => {});
|
||||
});
|
||||
|
||||
art.font('Ghost Wire BBS', 'Doom', (logo) => {
|
||||
art.font('No place like home', 'rusted', (subtext) => {
|
||||
art.table({
|
||||
verticalBar : ' ',
|
||||
horizontalBar : ' ',
|
||||
intersection : ' ',
|
||||
data: [
|
||||
{name: art.style('current users', 'red'), value: '203'},
|
||||
{name: 'operator', value: 'vince.vega'},
|
||||
{name: 'dial-in', value: '(917)555-4202'},
|
||||
]
|
||||
}).lines(2, (table: any) => {
|
||||
art.image({
|
||||
filepath : '~/Images/starburst_red.jpg',
|
||||
alphabet : 'ultra-wide'
|
||||
}).lines(2, 30).overlay(logo, {
|
||||
x: 0,
|
||||
y: 0,
|
||||
style: 'blue',
|
||||
}).overlay(subtext, {
|
||||
x: 19,
|
||||
y: 8,
|
||||
style: 'yellow',
|
||||
}).overlay(table, {
|
||||
x: -1,
|
||||
y: -1,
|
||||
style: 'green',
|
||||
}, (_final: any) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
art.image({
|
||||
width : 40,
|
||||
filepath : '/Images/initech.png',
|
||||
alphabet : 'wide'
|
||||
}).font('INITECH', 'Doom', 'cyan', (_ascii) => {
|
||||
});
|
||||
|
||||
art.table({
|
||||
data: [
|
||||
{text: ' .\'ANDRE. '},
|
||||
{text: ' ..THE.GIANT\'. '},
|
||||
{text: '.With.Bobby."The.Brain"'},
|
||||
{text: '.Heenan.'}
|
||||
],
|
||||
verticalBar : ' ',
|
||||
horizontalBar : ' ',
|
||||
intersection : ' '
|
||||
}).lines(2, (table: any) => {
|
||||
art.strings([
|
||||
'ANDRE',
|
||||
'the',
|
||||
'GIANT',
|
||||
'POSSE',
|
||||
'7\'4"',
|
||||
'520 LB'
|
||||
], 'rusted', (andre: any, the: any, giant: any, posse: any, height: any, weight: any) => {
|
||||
art.strings([ 'has', 'a'], 'twopoint', (has: any, a: any) => {
|
||||
art.image({
|
||||
filepath : '/Images/andre_has_a_posse.jpeg',
|
||||
alphabet : 'ultra-wide'
|
||||
}).overlay(andre, {
|
||||
x: 8, y: 4,
|
||||
style: 'white'
|
||||
}).overlay(the, {
|
||||
x: 10, y: 7,
|
||||
style: 'white',
|
||||
transparent : true
|
||||
}).overlay(giant, {
|
||||
x: 8, y: 10,
|
||||
style: 'white',
|
||||
transparent : true
|
||||
}).overlay(has, {
|
||||
x: 10, y: 14,
|
||||
style: 'white'
|
||||
}).overlay(a, {
|
||||
x: 13, y: 17,
|
||||
style: 'white'
|
||||
}).overlay(posse, {
|
||||
x: 5, y: 20,
|
||||
style: 'bright_black',
|
||||
transparent: true
|
||||
}).overlay(height, {
|
||||
x: 59, y: 3,
|
||||
style: 'bright_black',
|
||||
transparent: true
|
||||
}).overlay(weight, {
|
||||
x: 59, y: 8,
|
||||
style: 'bright_black',
|
||||
transparent: true
|
||||
}).overlay(table, {
|
||||
x: 6, y: -6,
|
||||
style: 'bright_black',
|
||||
transparent: true
|
||||
}, (_final: any) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
art.Figlet.fontPath = 'Fonts';
|
||||
|
||||
const image = new art.Image({
|
||||
filepath: '~/Images/metropolis.jpg',
|
||||
alphabet: 'variant4'
|
||||
});
|
||||
image.write((_err: any, _rendered: string) => {
|
||||
});
|
||||
|
||||
art.font('Prompt', 'Basic', 'red').font('v1', 'Doom', 'magenta', (_rendered) => {
|
||||
});
|
||||
|
||||
art.image({
|
||||
width : 40,
|
||||
filepath : '/Images/initech.png',
|
||||
alphabet : 'wide'
|
||||
}).font('INITECH', 'Doom', 'cyan', (_ascii) => {
|
||||
});
|
||||
|
||||
art.style('my text', 'red+underline');
|
||||
|
||||
art.table({
|
||||
width : 80,
|
||||
data : [ /* ... */ ],
|
||||
verticalBar : ' ',
|
||||
horizontalBar : ' ',
|
||||
intersection : ' ',
|
||||
columns : [
|
||||
{
|
||||
value : 'Product',
|
||||
style : 'black+gray_bg'
|
||||
}, {
|
||||
value : 'Maker',
|
||||
style : 'white'
|
||||
}, {
|
||||
value : 'Location',
|
||||
style : 'white'
|
||||
}
|
||||
]
|
||||
}, (_rendered) => {
|
||||
// use rendered text
|
||||
});
|
||||
|
||||
art.table({
|
||||
width : 80,
|
||||
data : [ /* ... */ ],
|
||||
bars : {
|
||||
ul_corner: '┏',
|
||||
ur_corner: '┓',
|
||||
lr_corner: '┛',
|
||||
ll_corner: '┗',
|
||||
bottom_t: '┻',
|
||||
top_t: '┳',
|
||||
right_t: '┫',
|
||||
left_t: '┣',
|
||||
intersection: '╋',
|
||||
vertical: '┃',
|
||||
horizontal: '━',
|
||||
},
|
||||
borderColor : 'bright_white',
|
||||
}, (_rendered) => {
|
||||
// use rendered text
|
||||
});
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
// Type definitions for ascii-art 1.4
|
||||
// Project: https://github.com/khrome/ascii-art
|
||||
// Definitions by: Lukas Elmer <https://github.com/lukaselmer>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export type StyleType = (text: string, style?: string, close?: boolean) => Art;
|
||||
export type FontType = ((text: string, font?: string, styleOrCallback?: string | Cb, callback?: Cb) => Art);
|
||||
export type ImageType = (options: object, callback?: Cb) => Art;
|
||||
export type TableType = (options: object, callback?: Cb) => Art;
|
||||
export type ArtworkType = (options: object, callback?: Cb) => Art;
|
||||
export type LinesType = (...options: any[]) => Art;
|
||||
export type OverlayType = (...options: any[]) => Art;
|
||||
export type JoinType = (...options: any[]) => Art;
|
||||
export type StringsType = (...options: any[]) => Art;
|
||||
|
||||
export const style: StyleType;
|
||||
export const font: FontType;
|
||||
export const image: ImageType;
|
||||
export const table: TableType;
|
||||
export const artwork: ArtworkType;
|
||||
export const lines: LinesType;
|
||||
export const overlay: OverlayType;
|
||||
export const join: JoinType;
|
||||
export const strings: StringsType;
|
||||
export const Figlet: any;
|
||||
export const Image: any;
|
||||
|
||||
export interface Art {
|
||||
style: StyleType;
|
||||
font: FontType;
|
||||
image: ImageType;
|
||||
table: TableType;
|
||||
artwork: ArtworkType;
|
||||
lines: LinesType;
|
||||
overlay: OverlayType;
|
||||
join: JoinType;
|
||||
working: boolean;
|
||||
|
||||
toPromise: (() => Promise<string>);
|
||||
}
|
||||
|
||||
export type Cb = (result: string) => void;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ascii-art-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+46
-12
@@ -4,6 +4,7 @@
|
||||
// Matt Durrant <https://github.com/mdurrant>
|
||||
// Peter Blazejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export as namespace auth0;
|
||||
|
||||
@@ -172,7 +173,7 @@ export class WebAuth {
|
||||
*
|
||||
* @param callback: any(err, token_payload)
|
||||
*/
|
||||
parseHash(callback: Auth0Callback<Auth0DecodedHash>): void;
|
||||
parseHash(callback: Auth0Callback<Auth0DecodedHash | null, Auth0ParseHashError>): void;
|
||||
|
||||
/**
|
||||
* Parse the url hash and extract the returned tokens depending on the transaction.
|
||||
@@ -183,7 +184,7 @@ export class WebAuth {
|
||||
*
|
||||
* @param callback: any(err, token_payload)
|
||||
*/
|
||||
parseHash(options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash>): void;
|
||||
parseHash(options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash | null, Auth0ParseHashError>): void;
|
||||
|
||||
/**
|
||||
* Decodes the id_token and verifies the nonce.
|
||||
@@ -482,7 +483,7 @@ export class CrossOriginAuthentication {
|
||||
callback(): void;
|
||||
}
|
||||
|
||||
export type Auth0Callback<T> = (error: null | Auth0Error, result: T) => void;
|
||||
export type Auth0Callback<T, E = Auth0Error> = (error: null | E, result: T) => void;
|
||||
|
||||
export interface TokenProvider {
|
||||
enableCache?: boolean;
|
||||
@@ -522,18 +523,51 @@ export interface PasswordlessAuthOptions {
|
||||
email: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* These are error codes defined by the auth0-js lib.
|
||||
*/
|
||||
export type LibErrorCodes = 'timeout' | 'request_error' | 'invalid_token';
|
||||
|
||||
/**
|
||||
* The user was not logged in at Auth0, so silent authentication is not possible.
|
||||
*/
|
||||
export type LoginRequiredErrorCode = 'login_required';
|
||||
|
||||
/**
|
||||
* The user was logged in at Auth0 and has authorized the application, but needs to
|
||||
* be redirected elsewhere before authentication can be completed; for example, when
|
||||
* using a redirect rule.
|
||||
*/
|
||||
export type InteractionRequiredErrorCode = 'interaction_required';
|
||||
|
||||
/**
|
||||
* The user was logged in at Auth0, but needs to give consent to authorize the application.
|
||||
*/
|
||||
export type ConsentRequiredErrorCode = 'consent_required';
|
||||
|
||||
/**
|
||||
* These are error codes defined by the OpenID Connect specification.
|
||||
*/
|
||||
export type SpecErrorCodes =
|
||||
LoginRequiredErrorCode |
|
||||
InteractionRequiredErrorCode |
|
||||
ConsentRequiredErrorCode |
|
||||
'account_selection_required' |
|
||||
'invalid_request_uri' |
|
||||
'invalid_request_object' |
|
||||
'request_not_supported' |
|
||||
'request_uri_not_supported' |
|
||||
'registration_not_supported';
|
||||
|
||||
export interface Auth0Error {
|
||||
error?: any;
|
||||
errorDescription?: string;
|
||||
code?: string;
|
||||
description?: string;
|
||||
name?: string;
|
||||
policy?: string;
|
||||
original?: any;
|
||||
statusCode?: number;
|
||||
statusText?: string;
|
||||
error: LibErrorCodes | SpecErrorCodes | string;
|
||||
errorDescription: string;
|
||||
}
|
||||
|
||||
export type Auth0ParseHashError = Auth0Error & {
|
||||
state?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The contents of the authResult object returned by {@link WebAuth#parseHash }
|
||||
*/
|
||||
|
||||
Vendored
+1
@@ -5,6 +5,7 @@
|
||||
// Larry Faudree <https://github.com/lfaudreejr>
|
||||
// Will Caulfield <https://github.com/willcaul>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
/// <reference types="auth0-js" />
|
||||
|
||||
|
||||
@@ -203,3 +203,26 @@ management.linkUsers('primaryId', { user_id: 'secondaryId' })
|
||||
management.linkUsers('primaryId', { user_id: 'secondaryId' },
|
||||
(err: Error, result: any) => {});
|
||||
|
||||
// Get all clients (with promise)
|
||||
management.getClients()
|
||||
.then((clients: auth0.Client[]) => {
|
||||
console.log(clients);
|
||||
})
|
||||
.catch((err) => {
|
||||
// Handle the error
|
||||
});
|
||||
|
||||
//Get all clients (with callback)
|
||||
management.getClients((err: Error, clients: auth0.Client[]) => {});
|
||||
|
||||
// Get all clients with params (with promise)
|
||||
management.getClients({fields:['name','client_metadata'], include_fields:true})
|
||||
.then((clients: auth0.Client[]) => {
|
||||
console.log(clients);
|
||||
})
|
||||
.catch((err) => {
|
||||
// Handle the error
|
||||
});
|
||||
|
||||
// Get all cients with params (with callback)
|
||||
management.getClients({fields:['name','client_metadata'], include_fields:true}, (err:Error, clients:auth0.Client[]) => {});
|
||||
|
||||
Vendored
+17
-4
@@ -1,6 +1,6 @@
|
||||
// Type definitions for auth0 2.9.2
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>, Amiram Korach <https://github.com/amiram>
|
||||
// Definitions by: Seth Westphal <https://github.com/westy92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -588,7 +588,19 @@ export interface ImpersonateSettingOptions {
|
||||
clientId?: string;
|
||||
}
|
||||
|
||||
|
||||
export type ClientAppType = 'native' | 'spa' | 'regular_web' | 'non_interactive' | 'rms' | 'box' |
|
||||
'cloudbees' | 'concur' | 'dropbox' | 'mscrm' | 'echosign' | 'egnyte' | 'newrelic' | 'office365' |
|
||||
'salesforce' | 'sentry' | 'sharepoint' | 'slack' | 'springcm' | 'zendesk' | 'zoom';
|
||||
export interface GetClientsOptions {
|
||||
fields?: string[];
|
||||
include_fields?: boolean;
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
include_totals?: boolean;
|
||||
is_global?: boolean;
|
||||
is_first_party?: boolean;
|
||||
app_type?: ClientAppType[];
|
||||
}
|
||||
|
||||
export class AuthenticationClient {
|
||||
|
||||
@@ -661,8 +673,9 @@ export class ManagementClient {
|
||||
|
||||
|
||||
// Clients
|
||||
getClients(): Promise<Client[]>;
|
||||
getClients(cb: (err: Error, clients: Client[]) => void): void;
|
||||
getClients(params?: GetClientsOptions): Promise<Client[]>;
|
||||
getClients(cb: (err: Error, clients: Client[]) => void ): void;
|
||||
getClients(params: GetClientsOptions, cb: (err: Error, clients: Client[]) => void ): void;
|
||||
|
||||
getClient(params: ClientParams): Promise<Client>;
|
||||
getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void;
|
||||
|
||||
Vendored
+2
@@ -190,6 +190,8 @@ declare namespace autobahn {
|
||||
export class Connection {
|
||||
constructor(options?: IConnectionOptions);
|
||||
|
||||
isOpen: boolean;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(reason?: string, message?: string): void;
|
||||
|
||||
@@ -8,6 +8,7 @@ declare let error: Error;
|
||||
declare let bool: boolean;
|
||||
declare let boolOrUndefined: boolean | undefined;
|
||||
declare let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext;
|
||||
declare let apiGwEvtReqCtxOpt: AWSLambda.APIGatewayEventRequestContext | null | undefined;
|
||||
declare let apiGwEvt: AWSLambda.APIGatewayEvent;
|
||||
declare let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent;
|
||||
declare let clientCtx: AWSLambda.ClientContext;
|
||||
@@ -102,11 +103,13 @@ str = apiGwEvtReqCtx.resourcePath;
|
||||
/* API Gateway Event */
|
||||
strOrNull = apiGwEvt.body;
|
||||
str = apiGwEvt.headers["example"];
|
||||
str = apiGwEvt.multiValueHeaders["example"][0];
|
||||
str = apiGwEvt.httpMethod;
|
||||
bool = apiGwEvt.isBase64Encoded;
|
||||
str = apiGwEvt.path;
|
||||
str = apiGwEvt.pathParameters!["example"];
|
||||
str = apiGwEvt.queryStringParameters!["example"];
|
||||
str = apiGwEvt.multiValueQueryStringParameters!["example"][0];
|
||||
str = apiGwEvt.stageVariables!["example"];
|
||||
apiGwEvtReqCtx = apiGwEvt.requestContext;
|
||||
str = apiGwEvt.resource;
|
||||
@@ -115,10 +118,12 @@ str = apiGwEvt.resource;
|
||||
str = customAuthorizerEvt.type;
|
||||
str = customAuthorizerEvt.methodArn;
|
||||
strOrUndefined = customAuthorizerEvt.authorizationToken;
|
||||
str = apiGwEvt.pathParameters!["example"];
|
||||
str = apiGwEvt.queryStringParameters!["example"];
|
||||
str = apiGwEvt.stageVariables!["example"];
|
||||
apiGwEvtReqCtx = apiGwEvt.requestContext;
|
||||
str = customAuthorizerEvt.headers!["example"];
|
||||
str = customAuthorizerEvt.multiValueHeaders!["example"][0];
|
||||
str = customAuthorizerEvt.pathParameters!["example"];
|
||||
str = customAuthorizerEvt.queryStringParameters!["example"];
|
||||
str = customAuthorizerEvt.multiValueQueryStringParameters!["example"][0];
|
||||
apiGwEvtReqCtxOpt = customAuthorizerEvt.requestContext;
|
||||
|
||||
/* DynamoDB Stream Event */
|
||||
const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = {
|
||||
@@ -245,6 +250,9 @@ num = proxyResult.statusCode;
|
||||
proxyResult.headers!["example"] = str;
|
||||
proxyResult.headers!["example"] = bool;
|
||||
proxyResult.headers!["example"] = num;
|
||||
proxyResult.multiValueHeaders!["example"][0] = str;
|
||||
proxyResult.multiValueHeaders!["example"][0] = bool;
|
||||
proxyResult.multiValueHeaders!["example"][0] = num;
|
||||
boolOrUndefined = proxyResult.isBase64Encoded;
|
||||
str = proxyResult.body;
|
||||
|
||||
@@ -383,6 +391,8 @@ cognitoUserPoolEvent.triggerSource === "TokenGeneration_Authentication";
|
||||
cognitoUserPoolEvent.triggerSource === "TokenGeneration_NewPasswordChallenge";
|
||||
cognitoUserPoolEvent.triggerSource === "TokenGeneration_AuthenticateDevice";
|
||||
cognitoUserPoolEvent.triggerSource === "TokenGeneration_RefreshTokens";
|
||||
cognitoUserPoolEvent.triggerSource === "UserMigration_Authentication";
|
||||
cognitoUserPoolEvent.triggerSource === "UserMigration_ForgotPassword";
|
||||
str = cognitoUserPoolEvent.region;
|
||||
str = cognitoUserPoolEvent.userPoolId;
|
||||
strOrUndefined = cognitoUserPoolEvent.userName;
|
||||
@@ -404,6 +414,7 @@ strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetadata;
|
||||
strOrUndefined = cognitoUserPoolEvent.request.challengeName;
|
||||
str = cognitoUserPoolEvent.request.privateChallengeParameters!["answer"];
|
||||
str = cognitoUserPoolEvent.request.challengeAnswer!;
|
||||
strOrUndefined = cognitoUserPoolEvent.request.password;
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect;
|
||||
strOrUndefined = cognitoUserPoolEvent.response.smsMessage;
|
||||
strOrUndefined = cognitoUserPoolEvent.response.emailMessage;
|
||||
@@ -415,6 +426,14 @@ str = cognitoUserPoolEvent.response.publicChallengeParameters!["captchaUrl"];
|
||||
str = cognitoUserPoolEvent.response.privateChallengeParameters!["answer"];
|
||||
strOrUndefined = cognitoUserPoolEvent.response.challengeMetadata;
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect;
|
||||
str = cognitoUserPoolEvent.response.userAttributes!["username"];
|
||||
cognitoUserPoolEvent.response.finalUserStatus === "CONFIRMED";
|
||||
cognitoUserPoolEvent.response.finalUserStatus === "RESET_REQUIRED";
|
||||
cognitoUserPoolEvent.response.messageAction === "SUPPRESS";
|
||||
cognitoUserPoolEvent.response.desiredDeliveryMediums === ["EMAIL"];
|
||||
cognitoUserPoolEvent.response.desiredDeliveryMediums === ["SMS"];
|
||||
cognitoUserPoolEvent.response.desiredDeliveryMediums === ["SMS", "EMAIL"];
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.forceAliasCreation;
|
||||
|
||||
// CloudFormation Custom Resource
|
||||
switch (cloudformationCustomResourceEvent.RequestType) {
|
||||
|
||||
Vendored
+18
-1
@@ -22,6 +22,8 @@
|
||||
// Louis Larry <https://github.com/louislarry>
|
||||
// Daniel Papukchiev <https://github.com/dpapukchiev>
|
||||
// Oliver Hookins <https://github.com/ohookins>
|
||||
// Trevor Leach <https://github.com/trevor-leach>
|
||||
// James Gregory <https://github.com/jagregory>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -58,11 +60,13 @@ export interface APIGatewayEventRequestContext {
|
||||
export interface APIGatewayProxyEvent {
|
||||
body: string | null;
|
||||
headers: { [name: string]: string };
|
||||
multiValueHeaders: { [name: string]: string[] };
|
||||
httpMethod: string;
|
||||
isBase64Encoded: boolean;
|
||||
path: string;
|
||||
pathParameters: { [name: string]: string } | null;
|
||||
queryStringParameters: { [name: string]: string } | null;
|
||||
multiValueQueryStringParameters: { [name: string]: string[] } | null;
|
||||
stageVariables: { [name: string]: string } | null;
|
||||
requestContext: APIGatewayEventRequestContext;
|
||||
resource: string;
|
||||
@@ -75,8 +79,10 @@ export interface CustomAuthorizerEvent {
|
||||
methodArn: string;
|
||||
authorizationToken?: string;
|
||||
headers?: { [name: string]: string };
|
||||
multiValueHeaders?: { [name: string]: string[] };
|
||||
pathParameters?: { [name: string]: string } | null;
|
||||
queryStringParameters?: { [name: string]: string } | null;
|
||||
multiValueQueryStringParameters?: { [name: string]: string[] } | null;
|
||||
requestContext?: APIGatewayEventRequestContext;
|
||||
}
|
||||
|
||||
@@ -234,7 +240,9 @@ export interface CognitoUserPoolTriggerEvent {
|
||||
| "TokenGeneration_Authentication"
|
||||
| "TokenGeneration_NewPasswordChallenge"
|
||||
| "TokenGeneration_AuthenticateDevice"
|
||||
| "TokenGeneration_RefreshTokens";
|
||||
| "TokenGeneration_RefreshTokens"
|
||||
| "UserMigration_Authentication"
|
||||
| "UserMigration_ForgotPassword";
|
||||
region: string;
|
||||
userPoolId: string;
|
||||
userName?: string;
|
||||
@@ -256,6 +264,7 @@ export interface CognitoUserPoolTriggerEvent {
|
||||
challengeName?: string;
|
||||
privateChallengeParameters?: { [key: string]: string };
|
||||
challengeAnswer?: string;
|
||||
password?: string;
|
||||
};
|
||||
response: {
|
||||
autoConfirmUser?: boolean;
|
||||
@@ -269,6 +278,11 @@ export interface CognitoUserPoolTriggerEvent {
|
||||
privateChallengeParameters?: { [key: string]: string };
|
||||
challengeMetadata?: string;
|
||||
answerCorrect?: boolean;
|
||||
userAttributes?: { [key: string]: string };
|
||||
finalUserStatus?: "CONFIRMED" | "RESET_REQUIRED";
|
||||
messageAction?: "SUPPRESS";
|
||||
desiredDeliveryMediums?: Array<"EMAIL" | "SMS">;
|
||||
forceAliasCreation?: boolean;
|
||||
};
|
||||
}
|
||||
export type CognitoUserPoolEvent = CognitoUserPoolTriggerEvent;
|
||||
@@ -433,6 +447,9 @@ export interface APIGatewayProxyResult {
|
||||
headers?: {
|
||||
[header: string]: boolean | number | string;
|
||||
};
|
||||
multiValueHeaders?: {
|
||||
[header: string]: Array<boolean | number | string>;
|
||||
};
|
||||
body: string;
|
||||
isBase64Encoded?: boolean;
|
||||
}
|
||||
|
||||
Vendored
+41
@@ -1,6 +1,7 @@
|
||||
// Type definitions for better-scroll 1.12
|
||||
// Project: https://github.com/ustbhuangyi/better-scroll
|
||||
// Definitions by: cloudstone <https://github.com/stoneChen>
|
||||
// jack <https://github.com/cnjack>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.2
|
||||
@@ -42,6 +43,24 @@ export interface PullUpOption {
|
||||
threshold: number;
|
||||
}
|
||||
|
||||
export interface MouseWheelOption {
|
||||
speed: number;
|
||||
invert: boolean;
|
||||
easeTime: number;
|
||||
}
|
||||
|
||||
export interface ZoomOption {
|
||||
start: number;
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
|
||||
export interface InfinityOption {
|
||||
fetch: (count: number) => void;
|
||||
render: (item: any, div: Element) => Element;
|
||||
createTombstone: () => Element;
|
||||
}
|
||||
|
||||
export interface BounceObjectOption {
|
||||
top?: boolean;
|
||||
bottom?: boolean;
|
||||
@@ -49,6 +68,10 @@ export interface BounceObjectOption {
|
||||
right?: boolean;
|
||||
}
|
||||
|
||||
export interface DoubleClick {
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface EaseOption {
|
||||
swipe?: {
|
||||
style: string;
|
||||
@@ -73,6 +96,7 @@ export interface BsOption {
|
||||
directionLockThreshold: number;
|
||||
eventPassthrough: string | boolean;
|
||||
click: boolean;
|
||||
dblclick: boolean | DoubleClick;
|
||||
tap: boolean;
|
||||
bounce: boolean | BounceObjectOption;
|
||||
bounceTime: number;
|
||||
@@ -140,6 +164,23 @@ export interface BsOption {
|
||||
* }
|
||||
*/
|
||||
pullUpLoad: Partial<PullUpOption> | boolean;
|
||||
|
||||
// mouseWheel: {
|
||||
// speed: 20,
|
||||
// invert: false,
|
||||
// easeTime: 300
|
||||
// }
|
||||
mouseWheel: Partial<MouseWheelOption> | boolean;
|
||||
|
||||
// zoom: {
|
||||
// start: 1,
|
||||
// min: 1,
|
||||
// max: 4
|
||||
// }
|
||||
zoom: Partial<ZoomOption> | boolean;
|
||||
|
||||
// https://ustbhuangyi.github.io/better-scroll/doc/zh-hans/options-advanced.html
|
||||
infinity: Partial<InfinityOption> | boolean;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
|
||||
Vendored
+1
-1
@@ -45,7 +45,7 @@ interface ReductionContext {
|
||||
declare class BN {
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
base?: number,
|
||||
base?: number | 'hex',
|
||||
endian?: Endianness
|
||||
);
|
||||
constructor(
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'bootstrap-toggle';
|
||||
|
||||
const $elem = $("#toggle");
|
||||
|
||||
// Test Initialise Cases
|
||||
$elem.bootstrapToggle();
|
||||
|
||||
$elem.bootstrapToggle({});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
// Defaults from source project
|
||||
on: 'On',
|
||||
off: 'Off',
|
||||
onstyle: 'primary',
|
||||
offstyle: 'default',
|
||||
size: 'normal',
|
||||
style: '',
|
||||
width: null,
|
||||
height: null
|
||||
});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
width: 100,
|
||||
height: 100
|
||||
});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
width: "100%",
|
||||
height: "100%"
|
||||
});
|
||||
|
||||
// Methods
|
||||
$elem.bootstrapToggle("destroy");
|
||||
$elem.bootstrapToggle("on");
|
||||
$elem.bootstrapToggle("off");
|
||||
$elem.bootstrapToggle("toggle");
|
||||
$elem.bootstrapToggle("enable");
|
||||
$elem.bootstrapToggle("disable");
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for bootstrap-toggle 2.2
|
||||
// Project: https://github.com/minhur/bootstrap-toggle
|
||||
// Definitions by: Mitchell Grice <https://github.com/gricey432>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface BootstrapToggleOptions {
|
||||
on?: string;
|
||||
off?: string;
|
||||
size?: string;
|
||||
onstyle?: string;
|
||||
offstyle?: string;
|
||||
style?: string;
|
||||
width?: number | string | null;
|
||||
height?: number | string | null;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
bootstrapToggle(options?: BootstrapToggleOptions): JQuery;
|
||||
bootstrapToggle(command: "destroy" | "on" | "off" | "toggle" | "enable" | "disable"): JQuery;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bootstrap-toggle-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import * as caniuse from "caniuse-api";
|
||||
|
||||
caniuse.features; // $ExpectType string[]
|
||||
|
||||
caniuse.getSupport(""); // $ExpectType BrowserSupport
|
||||
|
||||
caniuse.isSupported("", ""); // $ExpectType boolean
|
||||
caniuse.isSupported("", [""]); // $ExpectType boolean
|
||||
|
||||
caniuse.find(""); // $ExpectType string[]
|
||||
|
||||
caniuse.getLatestStableBrowsers(); // $ExpectType string[]
|
||||
|
||||
caniuse.setBrowserScope(""); // $ExpectType void
|
||||
caniuse.setBrowserScope([""]); // $ExpectType void
|
||||
|
||||
caniuse.getBrowserScope(); // $ExpectType string[]
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// Type definitions for caniuse-api 3.0
|
||||
// Project: https://github.com/nyalab/caniuse-api#readme
|
||||
// Definitions by: Dave Cardwell <https://github.com/davecardwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const features: string[];
|
||||
|
||||
export interface BrowserSupport {
|
||||
[browser: string]: {
|
||||
y?: number;
|
||||
n?: number;
|
||||
a?: number;
|
||||
x?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function getSupport(feature: string): BrowserSupport;
|
||||
|
||||
export function isSupported(
|
||||
feature: string,
|
||||
browsers: string | ReadonlyArray<string>
|
||||
): boolean;
|
||||
|
||||
export function find(query: string): string[];
|
||||
|
||||
export function getLatestStableBrowsers(): string[];
|
||||
|
||||
export function setBrowserScope(
|
||||
browserscope: string | ReadonlyArray<string>
|
||||
): void;
|
||||
|
||||
export function getBrowserScope(): string[];
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "caniuse-api-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -808,6 +808,24 @@ function frozen() {
|
||||
expect(Object.freeze({})).to.be.frozen;
|
||||
({}).should.be.not.frozen;
|
||||
Object.freeze({}).should.be.frozen;
|
||||
|
||||
expect([1, 2, 3]).to.have.all.members([1, 2, 3]);
|
||||
expect([1, 2, 3]).to.have.all.members(Object.freeze([1, 2, 3]));
|
||||
|
||||
expect({1: "", 2: "", 3: ""}).to.have.all.keys([1, 2, 3]);
|
||||
expect({1: "", 2: "", 3: ""}).to.have.all.keys(Object.freeze([1, 2, 3]));
|
||||
|
||||
assert.notDeepInclude([1, 2, 3], 1);
|
||||
assert.notDeepInclude(Object.freeze([1, 2, 3]), 1);
|
||||
|
||||
assert.include([1, 2, 3], 1);
|
||||
assert.include(Object.freeze([1, 2, 3]), 1);
|
||||
|
||||
assert.notInclude([1, 2, 3], 1);
|
||||
assert.notInclude(Object.freeze([1, 2, 3]), 1);
|
||||
|
||||
expect([1, 2, 3]).to.have.oneOf([1, 2, 3]);
|
||||
expect([1, 2, 3]).to.have.oneOf(Object.freeze([1, 2, 3]));
|
||||
}
|
||||
|
||||
class PoorlyConstructedError {
|
||||
|
||||
Vendored
+6
-6
@@ -118,7 +118,7 @@ declare namespace Chai {
|
||||
extensible: Assertion;
|
||||
sealed: Assertion;
|
||||
frozen: Assertion;
|
||||
oneOf(list: any[], message?: string): Assertion;
|
||||
oneOf(list: ReadonlyArray<any>, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface LanguageChains {
|
||||
@@ -235,7 +235,7 @@ declare namespace Chai {
|
||||
|
||||
interface Keys {
|
||||
(...keys: string[]): Assertion;
|
||||
(keys: any[]|Object): Assertion;
|
||||
(keys: ReadonlyArray<any>|Object): Assertion;
|
||||
}
|
||||
|
||||
interface Throw {
|
||||
@@ -252,7 +252,7 @@ declare namespace Chai {
|
||||
}
|
||||
|
||||
interface Members {
|
||||
(set: any[], message?: string): Assertion;
|
||||
(set: ReadonlyArray<any>, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface PropertyChange {
|
||||
@@ -696,7 +696,7 @@ declare namespace Chai {
|
||||
* @param needle Potential value contained in haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
include<T>(haystack: T[], needle: T, message?: string): void;
|
||||
include<T>(haystack: ReadonlyArray<T>, needle: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack does not include needle.
|
||||
@@ -705,7 +705,7 @@ declare namespace Chai {
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notInclude(haystack: string | any[], needle: any, message?: string): void;
|
||||
notInclude(haystack: string | ReadonlyArray<any>, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
@@ -732,7 +732,7 @@ declare namespace Chai {
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepInclude(haystack: string | any[], needle: any, message?: string): void;
|
||||
notDeepInclude(haystack: string | ReadonlyArray<any>, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Song, HtmlTableFormatter } from 'chordsheetjs';
|
||||
|
||||
const song = new Song({ key: 'value' });
|
||||
const formatter = new HtmlTableFormatter();
|
||||
formatter.format(song);
|
||||
Vendored
+372
@@ -0,0 +1,372 @@
|
||||
// Type definitions for chordsheetjs 2.8
|
||||
// Project: https://github.com/martijnversluis/ChordSheetJS
|
||||
// Definitions by: Adam Bloom <https://github.com/adamsbloom>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/**
|
||||
* Represents a chord with the corresponding (partial) lyrics
|
||||
*/
|
||||
export class ChordLyricsPair {
|
||||
/**
|
||||
* Initialises a ChordLyricsPair
|
||||
* @param chords The chords
|
||||
* @param lyrics The lyrics
|
||||
*/
|
||||
constructor(chords: string, lyrics: string);
|
||||
|
||||
chords: string;
|
||||
lyrics: string;
|
||||
|
||||
/**
|
||||
* Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
|
||||
*/
|
||||
isRenderable: () => boolean;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song
|
||||
*/
|
||||
clone: () => ChordLyricsPair;
|
||||
|
||||
toString: () => string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a tag/directive. See https://www.chordpro.org/chordpro/ChordPro-Directives.html
|
||||
*/
|
||||
export class Tag {
|
||||
constructor(name: string, value: string | null);
|
||||
|
||||
/**
|
||||
* The tag full name. When the original tag used the short name, `name` will return the full name.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The tag value
|
||||
*/
|
||||
value: string | null;
|
||||
|
||||
static parse(tag: string): Tag | null;
|
||||
static parseWithRegex(tag: string, regex: string): Tag | null;
|
||||
|
||||
/**
|
||||
* The original tag name that was used to construct the tag.
|
||||
*/
|
||||
originalName: string;
|
||||
|
||||
/**
|
||||
* Checks whether the tag value is a non-empty string.
|
||||
*/
|
||||
hasValue(): boolean;
|
||||
|
||||
/**
|
||||
* Checks whether the tag is usually rendered inline. It currently only applies to comment tags.
|
||||
*/
|
||||
isRenderable(): boolean;
|
||||
|
||||
/**
|
||||
* Checks whether the tag is either a standard meta tag or a custom meta directive (`{x_some_name}`)
|
||||
*/
|
||||
isMetaTag(): boolean;
|
||||
|
||||
/**
|
||||
* Returns a clone of the tag.
|
||||
*/
|
||||
clone(): Tag;
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag
|
||||
*/
|
||||
export class Line {
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* The items (ChordLyricsPair or Tag) of which the line consists
|
||||
*/
|
||||
items: Array<ChordLyricsPair | Tag>;
|
||||
|
||||
/**
|
||||
* The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse}
|
||||
* Values can be 'verse', 'chorus' or 'none'
|
||||
*/
|
||||
type: 'verse' | 'chorus' | 'none';
|
||||
|
||||
/**
|
||||
* Indicates whether the line contains any items
|
||||
*/
|
||||
isEmpty(): boolean;
|
||||
|
||||
/**
|
||||
* Adds an item to the line
|
||||
* @param item The item to be added
|
||||
*/
|
||||
addItem(item: ChordLyricsPair | Tag): void;
|
||||
|
||||
/**
|
||||
* Indicates whether the line contains items that are renderable
|
||||
*/
|
||||
hasRenderableItems(): boolean;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of the line and all of its items
|
||||
*/
|
||||
clone(): Line;
|
||||
|
||||
/**
|
||||
* Indicates whether the line type is 'verse'
|
||||
*/
|
||||
isVerse(): boolean;
|
||||
|
||||
/**
|
||||
* Indicates whether the line type is 'chorus'
|
||||
*/
|
||||
isChorus(): boolean;
|
||||
|
||||
/**
|
||||
* Indicates whether the line contains items that are renderable. Please use hasRenderableItems
|
||||
* @deprecated
|
||||
*/
|
||||
hasContent(): boolean;
|
||||
|
||||
addChordLyricsPair(
|
||||
chords: ChordLyricsPair | string,
|
||||
lyrics: string
|
||||
): ChordLyricsPair;
|
||||
ensureChordLyricsPair(): void;
|
||||
chords(chr: string): void;
|
||||
lyrics(chr: string): void;
|
||||
addTag(name: Tag | string, value: string | null): Tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a paragraph of lines in a chord sheet
|
||||
*/
|
||||
export class Paragraph {
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* The Line items of which the paragraph consists
|
||||
*/
|
||||
lines: Line[];
|
||||
|
||||
addLine(line: Line): void;
|
||||
|
||||
/**
|
||||
* Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
|
||||
* If not, it returns 'indeterminate'.
|
||||
*/
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a song in a chord sheet. Currently a chord sheet can only have one song.
|
||||
*/
|
||||
export class Song {
|
||||
constructor(metadata: object);
|
||||
|
||||
/**
|
||||
* The Line items of which the song consists
|
||||
*/
|
||||
lines: Line[];
|
||||
|
||||
/**
|
||||
* The Paragraph items of which the song consists
|
||||
*/
|
||||
paragraphs: Paragraph[];
|
||||
|
||||
currentLine: Line;
|
||||
currentParagraph: Paragraph;
|
||||
assignMetaData(metadata: object): void;
|
||||
|
||||
/**
|
||||
* Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful
|
||||
* if you want to skip the "header lines": the lines that only contain meta data.
|
||||
*/
|
||||
bodyLines: Line[];
|
||||
|
||||
chords(chr: string): void;
|
||||
lyrics(chr: string): void;
|
||||
addLine(): Line;
|
||||
setCurrentLineType(type: string): void;
|
||||
flushLine(): void;
|
||||
finish(): void;
|
||||
addChordLyricsPair(): ChordLyricsPair;
|
||||
ensureLine(): void;
|
||||
addParagraph(): Paragraph;
|
||||
ensureParagraph(): void;
|
||||
addTag(tagContents: string): Tag;
|
||||
|
||||
/**
|
||||
* Returns a deep clone of the song
|
||||
*/
|
||||
clone(): Song;
|
||||
|
||||
setMetaData(name: string, value: string): void;
|
||||
metaData: object;
|
||||
optimizedMetaData: object;
|
||||
getOptimizedMetaData(): object;
|
||||
optimizeMetaDataValue(
|
||||
valueSet: string[] | undefined
|
||||
): string | string[] | null;
|
||||
getMetaData(name: string): string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a parser warning, currently only used by ChordProParser.
|
||||
*/
|
||||
export class ParserWarning {
|
||||
/**
|
||||
* The warning message
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The line number on which the warning occurred
|
||||
*/
|
||||
lineNumber: string;
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a ChordPro chord sheet
|
||||
*/
|
||||
export class ChordProParser {
|
||||
/**
|
||||
* Parses a ChordPro chord sheet into a song
|
||||
* @param chordProChordSheet The ChordPro chord sheet
|
||||
*/
|
||||
parse(chordProChordSheet: string): Song;
|
||||
|
||||
song: Song;
|
||||
lineNumber: number;
|
||||
sectionType: string;
|
||||
warnings: ParserWarning[];
|
||||
|
||||
parseDocument(document: string): void;
|
||||
readLyrics(chr: string): void;
|
||||
readChords(chr: string): void;
|
||||
readTag(chr: string): void;
|
||||
readComment(chr: string): void;
|
||||
finishTag(): void;
|
||||
resetTag(): void;
|
||||
applyTag(tag: Tag): void;
|
||||
startSection(sectionType: string, tag: Tag): void;
|
||||
endSection(sectionType: string, tag: Tag): void;
|
||||
checkCurrentSectionType(sectionType: string, tag: Tag): void;
|
||||
addWarning(message: string): void;
|
||||
}
|
||||
|
||||
export interface ChordSheetParserProps {
|
||||
preserveWhitespace: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a song into a plain text chord sheet
|
||||
*/
|
||||
export class ChordSheetParser {
|
||||
constructor(props: ChordSheetParserProps);
|
||||
|
||||
song: Song;
|
||||
lines: Line[];
|
||||
songLine: Line;
|
||||
chordLyricsPair: ChordLyricsPair;
|
||||
currentLine: number;
|
||||
lineCount: number;
|
||||
processingText: string;
|
||||
preserveWhitespace: boolean;
|
||||
|
||||
/**
|
||||
* Parses a chord sheet into a song
|
||||
* @param chordSheet The ChordPro chord sheet
|
||||
*/
|
||||
parse(chordSheet: string): Song;
|
||||
|
||||
parseLine(line: string): void;
|
||||
parseNonEmptyLine(line: string): void;
|
||||
initialize(document: string): void;
|
||||
readLine(): Line;
|
||||
hasNextLine(): boolean;
|
||||
parseLyricsWithChords(chordsLine: string, lyricsLine: string): void;
|
||||
processCharacters(chordsLine: string, lyricsLine: string): void;
|
||||
addCharacter(chr: string, nextChar: string): void;
|
||||
shouldAddCharacterToChords(nextChar: string): boolean;
|
||||
ensureChordLyricsPairInitialized(): void;
|
||||
}
|
||||
|
||||
export interface SongHeader {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
}
|
||||
|
||||
export class TextFormatter {
|
||||
constructor();
|
||||
/**
|
||||
* Formats a song into a plain text chord sheet
|
||||
* @param song The song to be formatted
|
||||
*/
|
||||
format(song: Song): string;
|
||||
formatHeader(header: SongHeader): string;
|
||||
formatParagraphs(song: Song): string;
|
||||
formatParagraph(paragraph: Paragraph): string;
|
||||
formatLine(line: Line): string;
|
||||
formatTitle(title: string): string;
|
||||
formatSubtitle(subtitle: string): string;
|
||||
formatTopLine(line: Line): string | null;
|
||||
chordLyricsPairLength(chordLyricsPair: ChordLyricsPair): number;
|
||||
formatItemTop(item: Tag | ChordLyricsPair | Line): string;
|
||||
formatLineBottom(line: Line): string;
|
||||
formatLineWithFormatter(
|
||||
line: Line,
|
||||
formatter: (x: string) => string
|
||||
): string;
|
||||
formatItemBottom(item: Tag | ChordLyricsPair | Line): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
||||
* PDF conversion.
|
||||
*/
|
||||
export class HtmlTableFormatter {
|
||||
constructor();
|
||||
/**
|
||||
* Formats a song into HTML.
|
||||
* @param song The song to be formatted
|
||||
*/
|
||||
format(song: Song): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.
|
||||
*/
|
||||
export class HtmlDivFormatter {
|
||||
constructor();
|
||||
/**
|
||||
* Formats a song into HTML.
|
||||
* @param song The song to be formatted
|
||||
*/
|
||||
format(song: Song): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a song into a ChordPro chord sheet
|
||||
*/
|
||||
export class ChordProFormatter {
|
||||
constructor();
|
||||
/**
|
||||
* Formats a song into a ChordPro chord sheet.
|
||||
* @param song The song to be formatted
|
||||
*/
|
||||
format(song: Song): string;
|
||||
|
||||
formatLine(line: Line): string;
|
||||
formatItem(item: Tag | ChordLyricsPair | Line): string;
|
||||
formatTag(tag: Tag): string;
|
||||
formatChordLyricsPair(chordLyricsPair: ChordLyricsPair): string;
|
||||
formatChordLyricsPairChords(chordLyricsPair: ChordLyricsPair): string;
|
||||
formatChordLyricsPairLyrics(chordLyricsPair: ChordLyricsPair): string;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "chordsheetjs-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+79
-40
@@ -612,7 +612,10 @@ declare namespace chrome {
|
||||
* @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds.
|
||||
*/
|
||||
maxHeight?: integer;
|
||||
/** Type of window to create */
|
||||
/**
|
||||
* @deprecated Deprecated since Chrome 69. All app windows use the 'shell' window type.
|
||||
* @description Type of window to create
|
||||
**/
|
||||
type?: 'shell';
|
||||
/**
|
||||
* If true, the window will have its own shelf icon.
|
||||
@@ -919,7 +922,8 @@ declare namespace chrome {
|
||||
level?: integer;
|
||||
}
|
||||
/**
|
||||
* Device properties by which to filter the list of returned audio devices. If the filter is not set or set to {}, returned device list will contain all available audio devices.
|
||||
* Device properties by which to filter the list of returned audio devices.
|
||||
* If the filter is not set or set to {}, returned device list will contain all available audio devices.
|
||||
*/
|
||||
interface Filter {
|
||||
/**
|
||||
@@ -1083,8 +1087,9 @@ declare namespace chrome {
|
||||
function getDevices(callback: (devices: Device[]) => void): void;
|
||||
|
||||
/**
|
||||
* Get a list of Bluetooth devices known to the system, including paired and recently discovered devices.
|
||||
* @param filter Since Chrome 67. Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned.
|
||||
* @since Chrome 67.
|
||||
* @description Get a list of Bluetooth devices known to the system, including paired and recently discovered devices.
|
||||
* @param filter Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned.
|
||||
* @param callback Called when the search is completed.
|
||||
*/
|
||||
function getDevices(filter: DeviceFilter, callback: (devices: Device[]) => void): void;
|
||||
@@ -2082,12 +2087,12 @@ declare namespace chrome {
|
||||
/**
|
||||
* **Dev channel only.**
|
||||
* Sets image data to clipboard
|
||||
* @param imageData The encoded image data. *Since Chrome 70. Warning: this is the current Beta channel.*
|
||||
* @param type The type of image being passed. *Since Chrome 70. Warning: this is the current Beta channel.*
|
||||
* @param imageData The encoded image data. *Since Chrome 71. Warning: this is the current Dev channel.*
|
||||
* @param type The type of image being passed. *Since Chrome 71. Warning: this is the current Dev channel.*
|
||||
* @param [additionalItems] Additional data items for describing image data.
|
||||
* The callback is called with chrome.runtime.lastError set to error code if there is an error.
|
||||
* Requires clipboard and clipboardWrite permissions.
|
||||
* *Since Chrome 70. Warning: this is the current Beta channel.*
|
||||
* *Since Chrome 71. Warning: this is the current Dev channel.*
|
||||
* @param [callback]
|
||||
*/
|
||||
function setImageData(imageData: ArrayBuffer, type: ImageType, additionalItems?: AdditionalItems, callback?: () => void): void;
|
||||
@@ -3078,7 +3083,8 @@ declare namespace chrome {
|
||||
'document_end' |
|
||||
'document_idle';
|
||||
/**
|
||||
* The origin of injected CSS.
|
||||
* @since Chrome 66.
|
||||
* @description The origin of injected CSS.
|
||||
**/
|
||||
type CSSOrigin =
|
||||
'author' |
|
||||
@@ -5968,6 +5974,11 @@ declare namespace chrome {
|
||||
SSID?: S;
|
||||
/** The network signal strength. */
|
||||
SignalStrength?: integer;
|
||||
/**
|
||||
* @since Chrome 70
|
||||
* @description The tethering state associated with the connection.
|
||||
*/
|
||||
TetheringState?: string;
|
||||
}
|
||||
interface WiFiProperties<M extends ManagedObject = 'unmanaged',
|
||||
OF extends _internal_.ObjectFunction = 'getter',
|
||||
@@ -6379,8 +6390,8 @@ declare namespace chrome {
|
||||
progress?: integer;
|
||||
|
||||
/**
|
||||
* Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
|
||||
* @since Chrome 32.
|
||||
* @deprecated Deprecated since Chrome 67. This UI hint is ignored as of Chrome 67
|
||||
* @description Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
|
||||
*/
|
||||
isClickable?: boolean;
|
||||
|
||||
@@ -6391,6 +6402,13 @@ declare namespace chrome {
|
||||
* @since Chrome 50
|
||||
*/
|
||||
requireInteraction?: boolean;
|
||||
|
||||
/**
|
||||
* @since Chrome 70.
|
||||
* @description Indicates that no sounds or vibrations should be made when the notification is being shown.
|
||||
* @default false
|
||||
*/
|
||||
silent?: boolean;
|
||||
}
|
||||
|
||||
/** The notification closed, either by the system or by user action. */
|
||||
@@ -6405,8 +6423,10 @@ declare namespace chrome {
|
||||
*/
|
||||
const onPermissionLevelChanged: chrome.events.Event<(level: string) => void>;
|
||||
/**
|
||||
* The user clicked on a link for the app's notification settings.
|
||||
* @since Chrome 32.
|
||||
* @deprecated Deprecated since Chrome 65. Custom notification settings button is no longer supported.
|
||||
* @description The user clicked on a link for the app's notification settings.
|
||||
* As of Chrome 47, only ChromeOS has UI that dispatches this event.
|
||||
* As of Chrome 65, that UI has been removed from ChromeOS, too.
|
||||
*/
|
||||
const onShowSettings: chrome.events.Event<() => void>;
|
||||
|
||||
@@ -9319,7 +9339,10 @@ declare namespace chrome {
|
||||
/** The display mode height in native pixels. */
|
||||
heightInNativePixels: integer;
|
||||
|
||||
/** The display mode UI scale factor. */
|
||||
/**
|
||||
* @deprecated Deprecated since Chrome 70. Use `displayZoomFactor`
|
||||
* @description The display mode UI scale factor.
|
||||
**/
|
||||
uiScale: integer;
|
||||
|
||||
/** The display mode device scale factor. */
|
||||
@@ -9380,15 +9403,16 @@ declare namespace chrome {
|
||||
* If set to true, changes the display mode to unified desktop.
|
||||
* If set to false, unified desktop mode will be disabled.
|
||||
* This is only valid for the primary display.
|
||||
* If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided.
|
||||
* @see(See enableUnifiedDesktop for details).
|
||||
* If provided, mirroringSourceId must not be provided and other properties may not apply.
|
||||
* This is has no effect if not provided.
|
||||
* @see(See `enableUnifiedDesktop` for details).
|
||||
* @since Chrome 59
|
||||
* */
|
||||
isUnified?: boolean;
|
||||
|
||||
/**
|
||||
* @requires(CrOS) Chrome OS only.
|
||||
* @deprecated Deprecated since Chrome 68. Use *setMirrorMode*
|
||||
* @deprecated Deprecated since Chrome 68. Use ´setMirrorMode´
|
||||
* @see setMirrorMode
|
||||
* @description
|
||||
* If set and not empty, enables mirroring for this display.
|
||||
@@ -9416,7 +9440,7 @@ declare namespace chrome {
|
||||
* If set, updates the display's rotation.
|
||||
* Legal values are [0, 90, 180, 270].
|
||||
* The rotation is set clockwise, relative to the display's vertical position.
|
||||
* It's applied after overscan paramter.
|
||||
* It's applied after overscan parameter.
|
||||
*/
|
||||
rotation?: 0 | 90 | 180 | 270;
|
||||
|
||||
@@ -9912,10 +9936,10 @@ declare namespace chrome {
|
||||
/** The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
|
||||
lang?: string;
|
||||
/**
|
||||
* This voice's gender.
|
||||
* One of: 'male', or 'female'
|
||||
* @deprecated Deprecated since Chrome 70. Gender is deprecated and will be ignored.
|
||||
* @description This voice's gender.
|
||||
*/
|
||||
gender?: string;
|
||||
gender?: 'male' | 'female';
|
||||
/** The name of the voice. */
|
||||
voiceName?: string;
|
||||
/** The ID of the extension providing this voice. */
|
||||
@@ -9959,10 +9983,10 @@ declare namespace chrome {
|
||||
/** The extension ID of the speech engine to use, if known. */
|
||||
extensionId?: string;
|
||||
/**
|
||||
* Gender of voice for synthesized speech.
|
||||
* One of: 'male', or 'female'
|
||||
* @deprecated Deprecated since Chrome 70. Gender is deprecated and will be ignored.
|
||||
* @description Gender of voice for synthesized speech.
|
||||
*/
|
||||
gender?: string;
|
||||
gender?: 'male' | 'female';
|
||||
/** The TTS event types the voice must support. */
|
||||
requiredEventTypes?: string[];
|
||||
/** The TTS event types that you are interested in listening to. If missing, all event types may be sent. */
|
||||
@@ -10983,7 +11007,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RequestMatcher {
|
||||
protected readonly typeGuard: 'RequestMatcher';
|
||||
constructor (parameters?: RequestMatcherFields);
|
||||
constructor(parameters?: RequestMatcherFields);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11001,7 +11025,7 @@ declare namespace chrome {
|
||||
/** Declarative event action that redirects a network request. */
|
||||
class RedirectRequest {
|
||||
protected readonly typeGuard: 'RedirectRequest';
|
||||
constructor (parameters: RedirectRequestParams);
|
||||
constructor(parameters: RedirectRequestParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11036,7 +11060,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RedirectByRegEx {
|
||||
protected readonly typeGuard: 'RedirectByRegEx';
|
||||
constructor (parameters: RedirectByRegExParams);
|
||||
constructor(parameters: RedirectByRegExParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11055,7 +11079,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class SetRequestHeader {
|
||||
protected readonly typeGuard: 'SetRequestHeader';
|
||||
constructor (parameters: SetRequestHeaderParams);
|
||||
constructor(parameters: SetRequestHeaderParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11072,7 +11096,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RemoveRequestHeader {
|
||||
protected readonly typeGuard: 'RemoveRequestHeader';
|
||||
constructor (parameters: RemoveRequestHeaderParams);
|
||||
constructor(parameters: RemoveRequestHeaderParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11091,7 +11115,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class AddResponseHeader {
|
||||
protected readonly typeGuard: 'AddResponseHeader';
|
||||
constructor (parameters: AddResponseHeaderParams);
|
||||
constructor(parameters: AddResponseHeaderParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11107,7 +11131,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RemoveResponseHeader {
|
||||
protected readonly typeGuard: 'RemoveResponseHeader';
|
||||
constructor (parameters: RemoveResponseHeaderParams);
|
||||
constructor(parameters: RemoveResponseHeaderParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11133,7 +11157,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class IgnoreRules {
|
||||
protected readonly typeGuard: 'IgnoreRules';
|
||||
constructor (parameters: IgnoreRulesParams);
|
||||
constructor(parameters: IgnoreRulesParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11150,7 +11174,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class SendMessageToExtension {
|
||||
protected readonly typeGuard: 'SendMessageToExtension';
|
||||
constructor (parameters: SendMessageParams);
|
||||
constructor(parameters: SendMessageParams);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11248,7 +11272,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class AddRequestCookie {
|
||||
protected readonly typeGuard: 'AddRequestCookie';
|
||||
constructor (parameters: AddCookie<RequestCookie>);
|
||||
constructor(parameters: AddCookie<RequestCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11259,7 +11283,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class AddResponseCookie {
|
||||
protected readonly typeGuard: 'AddResponseCookie';
|
||||
constructor (parameters: AddCookie<ResponseCookie>);
|
||||
constructor(parameters: AddCookie<ResponseCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11292,7 +11316,7 @@ declare namespace chrome {
|
||||
* @param modification Attributes that shall be overridden in cookies that machted the filter.
|
||||
* Attributes that are set to an empty string are removed.
|
||||
*/
|
||||
constructor (parameters: EditCookieParams<RequestCookie, RequestCookie>);
|
||||
constructor(parameters: EditCookieParams<RequestCookie, RequestCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11306,7 +11330,7 @@ declare namespace chrome {
|
||||
* @param filter Filter for cookies that will be modified.All empty entries are ignored.
|
||||
* @param modification
|
||||
*/
|
||||
constructor (parameter: EditCookieParams<FilterResponseCookie, ResponseCookie>);
|
||||
constructor(parameter: EditCookieParams<FilterResponseCookie, ResponseCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11316,7 +11340,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RemoveRequestCookie {
|
||||
protected readonly typeGuard: 'RemoveRequestCookie';
|
||||
constructor (parameters: RemoveCookieParams<RequestCookie>);
|
||||
constructor(parameters: RemoveCookieParams<RequestCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11340,7 +11364,7 @@ declare namespace chrome {
|
||||
*/
|
||||
class RemoveResponseCookie {
|
||||
protected readonly typeGuard: 'RemoveResponseCookie';
|
||||
constructor (parameters: RemoveCookieParams<FilterResponseCookie>);
|
||||
constructor(parameters: RemoveCookieParams<FilterResponseCookie>);
|
||||
public readonly instanceType: string;
|
||||
}
|
||||
|
||||
@@ -11518,7 +11542,7 @@ declare namespace chrome {
|
||||
*/
|
||||
declare class HTMLAppViewElement extends HTMLElement {
|
||||
/** Create a new AppView tag */
|
||||
constructor ();
|
||||
constructor();
|
||||
/**
|
||||
* Requests another app to be embedded.
|
||||
* @param app The extension id of the app to be embedded.
|
||||
@@ -11626,7 +11650,7 @@ declare class HTMLWebViewElement extends HTMLElement {
|
||||
src: string;
|
||||
|
||||
/** Create a new element */
|
||||
constructor ();
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Queries audio state.
|
||||
@@ -11908,6 +11932,21 @@ declare class HTMLWebViewElement extends HTMLElement {
|
||||
*/
|
||||
loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void;
|
||||
|
||||
/**
|
||||
* @since Chrome 71
|
||||
* @description Sets spatial navigation state of the webview.
|
||||
* @param enabled Spatial navigation state value.
|
||||
*/
|
||||
setSpatialNavigationEnabled(enabled: boolean): void;
|
||||
|
||||
/**
|
||||
* @since Chrome 71
|
||||
* @description Queries whether spatial navigation is enabled for the webview.
|
||||
* @param callback Callback that will provide the value of the spatial navigation state.
|
||||
*/
|
||||
isSpatialNavigationEnabled(callback: (enabled: boolean) => void): void;
|
||||
|
||||
|
||||
/**
|
||||
* Forcibly kills the guest web page's renderer process.
|
||||
* This may affect multiple webview tags in the current app if they share the same process,
|
||||
|
||||
@@ -1114,6 +1114,7 @@ chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => {
|
||||
if (networkObj.WiFi) {
|
||||
// WiFi active :)
|
||||
console.log('Wifi BSID: ' + networkObj.WiFi.BSSID);
|
||||
const state = networkObj.WiFi.TetheringState;
|
||||
}
|
||||
chrome.networking.onc.setProperties(networkObj.GUID || '', {
|
||||
WiFi: {
|
||||
@@ -1124,6 +1125,19 @@ chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => {
|
||||
chrome.networking.onc.getProperties(networkObj.GUID || '', (props) => {
|
||||
const WiFiResult = props.WiFi;
|
||||
});
|
||||
chrome.networking.onc.getState(networkObj.GUID || '', (state) => {
|
||||
const wifiState = state.WiFi || {};
|
||||
return wifiState.TetheringState;
|
||||
});
|
||||
chrome.networking.onc.getManagedProperties(networkObj.GUID || '', (result) => {
|
||||
const wifiResult = result.WiFi;
|
||||
if (wifiResult !== undefined) {
|
||||
const managed = wifiResult.HexSSID;
|
||||
if (managed !== undefined) {
|
||||
return managed.UserPolicy;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -4525,12 +4525,12 @@ declare namespace chrome.pageAction {
|
||||
* Shows the page action. The page action is shown whenever the tab is selected.
|
||||
* @param tabId The id of the tab for which you want to modify the page action.
|
||||
*/
|
||||
export function hide(tabId: number): void;
|
||||
export function hide(tabId: number, callback?: () => void): void;
|
||||
/**
|
||||
* Shows the page action. The page action is shown whenever the tab is selected.
|
||||
* @param tabId The id of the tab for which you want to modify the page action.
|
||||
*/
|
||||
export function show(tabId: number): void;
|
||||
export function show(tabId: number, callback?: () => void): void;
|
||||
/** Sets the title of the page action. This is displayed in a tooltip over the page action. */
|
||||
export function setTitle(details: TitleDetails): void;
|
||||
/** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */
|
||||
|
||||
@@ -230,3 +230,24 @@ table26.push(
|
||||
// feel free to use colors in your content strings, column widths will be calculated correctly
|
||||
const table27 = new Table({ colWidths: [5], style: { head: [], border: [] } }) as Table.HorizontalTable;
|
||||
table27.push([/*colors.red(*/'hello'/*)*/]);
|
||||
|
||||
// Header as text
|
||||
const table28 = new Table({ head: ["Top Header 1", "Top Header 2"] }) as Table.HorizontalTable;
|
||||
table28.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2']
|
||||
);
|
||||
|
||||
// Header as Cells
|
||||
const table29 = new Table({ head: [{content: "Top Header 1"}, {content: "Top Header 2"}] }) as Table.HorizontalTable;
|
||||
table29.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2']
|
||||
);
|
||||
|
||||
// ColSpan in header
|
||||
const table30 = new Table({ head: [{content: "Top Header 1", colSpan: 2}, {content: "Top Header 3"}] }) as Table.HorizontalTable;
|
||||
table30.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2', 'Value Row 1 Col 3'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2', 'Value Row 2 Col 3']
|
||||
);
|
||||
|
||||
Vendored
+1
-1
@@ -31,7 +31,7 @@ declare namespace CliTable2 {
|
||||
rowHeights: Array<number | null>;
|
||||
colAligns: HorizontalAlignment[];
|
||||
rowAligns: VerticalAlignment[];
|
||||
head: string[];
|
||||
head: Cell[];
|
||||
wordWrap: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
$("#table").colResizable(); // $ExpectType JQuery<HTMLElement>
|
||||
|
||||
$("#table").colResizable({
|
||||
resizeMode: "fit",
|
||||
disable: false,
|
||||
disabledColumns: [1, 2, 3],
|
||||
liveDrag: true,
|
||||
postbackSafe: false,
|
||||
partialRefresh: true,
|
||||
headerOnly: false,
|
||||
gripInnerHtml: "",
|
||||
draggingClass: ".myClass",
|
||||
minWidth: 100,
|
||||
hoverCursor: 'pointer',
|
||||
dragCursor: 'e-resize',
|
||||
flush: false,
|
||||
marginLeft: "14px",
|
||||
marginRight: "auto",
|
||||
fixed: false,
|
||||
|
||||
onResize(evt) {
|
||||
evt.currentTarget; // $ExpectType Element
|
||||
},
|
||||
onDrag(evt) {
|
||||
evt.currentTarget; // $ExpectType Element
|
||||
}
|
||||
});
|
||||
|
||||
// Samples at http://www.bacubacu.com/colresizable
|
||||
function onSampleResized(e: JQueryMouseEventObject) {
|
||||
const table = $(e.currentTarget); // reference to the resized table
|
||||
}
|
||||
|
||||
$("#sample").colResizable({
|
||||
liveDrag: true,
|
||||
gripInnerHtml: "<div class='grip'></div>",
|
||||
draggingClass: "dragging",
|
||||
onResize: onSampleResized
|
||||
});
|
||||
|
||||
function postbackSample() {
|
||||
$("#updatePanelSample").colResizable({
|
||||
liveDrag: true,
|
||||
postbackSafe: true,
|
||||
partialRefresh: true
|
||||
});
|
||||
}
|
||||
|
||||
$("#flexSample").colResizable({resizeMode: 'flex'});
|
||||
|
||||
$("#overflowSample").colResizable({resizeMode: 'overflow'});
|
||||
|
||||
function onSlide() {}
|
||||
|
||||
$("#sample5").colResizable({
|
||||
liveDrag: true,
|
||||
draggingClass: "rangeDrag",
|
||||
gripInnerHtml: "<div class='rangeGrip'></div>",
|
||||
onResize: onSlide,
|
||||
minWidth: 8
|
||||
});
|
||||
Vendored
+149
@@ -0,0 +1,149 @@
|
||||
// Type definitions for colresizable 1.6
|
||||
// Project: http://bacubacu.com/colresizable/
|
||||
// Definitions by: Gilles Waeber <https://github.com/gilleswaeber>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
interface JQuery {
|
||||
colResizable(param?: colResizable.Settings): JQuery;
|
||||
}
|
||||
|
||||
declare namespace colResizable {
|
||||
interface Settings {
|
||||
/**
|
||||
* [default: 'fit'] It is used to set how the resize method works. Those are the possible values:
|
||||
* - 'fit': this is default resizing model, in which resizing a column does not alter table width, which means that when a column is expanded the next one shrinks.
|
||||
* - 'flex': in this mode tables can change its width and each column can shrink or expand independently if there is enough space in the parent container.
|
||||
* If there is not enough space, columns will share its width as they are resized. Table will never get bigger than its parent.
|
||||
* - 'overflow': allows to resize columns with overflow of parent container.
|
||||
* [version: 1.6]
|
||||
*/
|
||||
resizeMode?: 'fit' | 'flex' | 'overflow';
|
||||
|
||||
/**
|
||||
* [default: false] When set to true the table layout is updated while dragging column anchors.
|
||||
* liveDrag enabled is more CPU consuming so it is not recommended for slow computers, specially when dealing with huge or extremely complicated tables.
|
||||
* [version: 1.0]
|
||||
*/
|
||||
liveDrag?: boolean;
|
||||
|
||||
/**
|
||||
* @deprecated use resizeMode instead
|
||||
* [default: true] It is used to set how the resize method works.
|
||||
* In fixed mode resizing a column does not alter total table width, which means that when a column is expanded the next one shrinks.
|
||||
* If fixed is set to false then table can change its width and each column can shrink or expand independently.
|
||||
* [version: 1.5]
|
||||
*/
|
||||
fixed?: boolean;
|
||||
|
||||
/**
|
||||
* [default: false] This attribute can be used to specify that the manually selected column widths must remain unaltered after a postback or browser refresh.
|
||||
* This feature is mainly oriented to those pages created with server-side logic (codebehind), such as PHP or .NET, and it is only compatible with browsers
|
||||
* with sessionStorage support (all modern browsers).
|
||||
* However, if you are targeting older browsers (such as IE7 and IE8) you can still emulate sessionStorage using sessionStorage.js.
|
||||
* It is important to note that some browsers (IE and FF) doesn’t enable the sessionStorage object while running the website directly from the local file system,
|
||||
* so if you want to test this feature it is recommended to view the website through a web server or use browsers such as Chrome or Opera which doesn’t have this limitation.
|
||||
* Don't worry about compatibility issues, once your site is up on the internet, all browsers will act in exactly the same way.
|
||||
* [version: 1.3]
|
||||
*/
|
||||
postbackSafe?: boolean;
|
||||
|
||||
/**
|
||||
* [default: false] This attribute should be set to true if the table is inside of an updatePanel or any other kind of partial page refresh using ajax.
|
||||
* Table's ID should be same before and after the partial partial refresh.
|
||||
* [version: 1.5]
|
||||
*/
|
||||
partialRefresh?: boolean;
|
||||
|
||||
/**
|
||||
* [default: false] This attribute can be used to prevent vertical expansion of the column anchors to fit the table height.
|
||||
* If it is set to true, column handler's size will be bounded to the first row's vertical size.
|
||||
* [version: 1.2]
|
||||
*/
|
||||
headerOnly?: boolean;
|
||||
|
||||
/**
|
||||
* [default: ""] Its purpose is to allow column anchor customization by defining the HTML to be used in the column grips to provide some visual feedback.
|
||||
* It can be used in a wide range of ways to obtain very different outputs, and its flexibility can be increased by combining it with the draggingClass attribute.
|
||||
* [version: 1.0]
|
||||
*/
|
||||
gripInnerHtml?: string;
|
||||
|
||||
/**
|
||||
* [default: (internal class)] This attribute is used as the css class assigned to column anchors while being dragged. It can be used for visual feedback purposes.
|
||||
* [version: 1.0]
|
||||
*/
|
||||
draggingClass?: string;
|
||||
|
||||
/**
|
||||
* [default: false] When set to true it aims to remove all previously added enhancements such as events and additional DOM elements assigned by this plugin to
|
||||
* a single or collection of tables. It is required to disable a previously colResized table prior its removal from the document object tree.
|
||||
* [version: 1.0]
|
||||
*/
|
||||
disable?: boolean;
|
||||
|
||||
/**
|
||||
* [default: [ ] ] An array of column indexes to be excluded, so it will not be possible to drag them manually.
|
||||
* [version: 1.6]
|
||||
*/
|
||||
disabledColumns?: number[];
|
||||
|
||||
/**
|
||||
* [default: 15] This value specifies the minimum width (measured in pixels) that is allowed for the columns.
|
||||
* [version: 1.1]
|
||||
*/
|
||||
minWidth?: number;
|
||||
|
||||
/**
|
||||
* [default: "e-resize"] This attribute can be used to customize the cursor that will be displayed when the user is positioned on the column anchors.
|
||||
* [version: 1.3]
|
||||
*/
|
||||
hoverCursor?: string;
|
||||
|
||||
/**
|
||||
* [default: "e-resize"] Defines the cursor that will be used while the user is resizing a column.
|
||||
* [version: 1.3]
|
||||
*/
|
||||
dragCursor?: string;
|
||||
|
||||
/**
|
||||
* [default: false] Flush is only effective when postbackSafe is enabled.
|
||||
* Its purpose is to remove all previously stored data related to the current table layout to get it back to its original layout preventing width restoration after postback.
|
||||
* [version: ]
|
||||
*/
|
||||
flush?: boolean;
|
||||
|
||||
/**
|
||||
* [default: null] If the target table contains an explicit margin-left CSS rule, the same value must be used in this attribute (for example: "auto", "20%", "10px").
|
||||
* The reason why it is needed it is because most browsers (all except of IE) don’t allow direct access to the current CSS rule applied to an element in
|
||||
* its original units (such as "%", "em" or "auto" values).
|
||||
* If you know any workaround which doesn’t involve iteration through all the styles defined in the site and any other external dependencies, please let me know!
|
||||
* [version: 1.3]
|
||||
*/
|
||||
marginLeft?: string;
|
||||
|
||||
/**
|
||||
* [default: null] It behaves in exactly the same way than the marginLeft attribute but applied to the right margin.
|
||||
* [version: 1.3]
|
||||
*/
|
||||
marginRight?: string;
|
||||
|
||||
/**
|
||||
* If a callback function is supplied it will be fired when the user has ended dragging a column anchor altering the previous table layout.
|
||||
* The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters
|
||||
* [version: 1.0]
|
||||
*/
|
||||
onResize?: FunctionCallback;
|
||||
|
||||
/**
|
||||
* This event is fired while dragging a column anchor if liveDrag is enabled. It can be useful if the table is being used as a multiple range slider.
|
||||
* The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters
|
||||
* [version: 1.1]
|
||||
*/
|
||||
onDrag?: FunctionCallback;
|
||||
}
|
||||
|
||||
type FunctionCallback = (e: JQueryMouseEventObject) => void;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"colresizable-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+12
-13
@@ -4,33 +4,33 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module commangular {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Commangular Static
|
||||
// see http://commangular.org/docs/#commangular-namespace
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface ICommAngularStatic {
|
||||
|
||||
|
||||
/**
|
||||
* Mock dispatch function for testing commands.
|
||||
*/
|
||||
dispatch( ec: ICommandCall, callback: Function ): void;
|
||||
}
|
||||
|
||||
|
||||
interface ICommandCall {
|
||||
/**
|
||||
* Name of the command that needs to
|
||||
* execute
|
||||
*/
|
||||
command: string;
|
||||
|
||||
|
||||
/**
|
||||
* Data that needs to be passed to the command
|
||||
*/
|
||||
data?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Object type expected to be passed into the callback function
|
||||
* of the dispatch() function
|
||||
@@ -41,25 +41,25 @@ declare module commangular {
|
||||
* @param key The property name that is in the object that was passed
|
||||
*/
|
||||
dataPassed( key : string ) : any;
|
||||
|
||||
|
||||
/**
|
||||
* The data that was returned by the command
|
||||
* @param key The result key that was defined in the command. If no result
|
||||
* was defined use 'lastResult' as the key
|
||||
*/
|
||||
resultKey( key: string ): any;
|
||||
|
||||
|
||||
/**
|
||||
* Indicates if the command execution was cancelled.
|
||||
*/
|
||||
canceled( ): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Indicates if the command was executed????
|
||||
*/
|
||||
commandExecuted( ): boolean;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ declare module commangular {
|
||||
* Mock dispatch function for testing commands.
|
||||
* @param ec an ICommandCall object
|
||||
* @param callback The function that will be called upon the completion of the command
|
||||
* function should expecte an ICommandInfo paramter.
|
||||
* function should expecte an ICommandInfo parameter.
|
||||
*/
|
||||
declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void;
|
||||
|
||||
declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import React = require('react');
|
||||
import enzyme = require('enzyme');
|
||||
import configureExtensions = require('@commercetools/enzyme-extensions');
|
||||
|
||||
configureExtensions(enzyme.ShallowWrapper);
|
||||
|
||||
function App() {
|
||||
return <Child cb={() => 'Hello world'} />;
|
||||
}
|
||||
|
||||
interface ChildProps {
|
||||
cb: () => string;
|
||||
}
|
||||
|
||||
function Child(props: ChildProps) {
|
||||
return <div>{props.cb()}</div>;
|
||||
}
|
||||
|
||||
enzyme.shallow(<App />)
|
||||
.find(App)
|
||||
.renderProp('render');
|
||||
enzyme.shallow(<App />)
|
||||
.find(Child)
|
||||
.renderProp('render', 1, 2);
|
||||
|
||||
enzyme.shallow(<App />)
|
||||
.find(Child)
|
||||
.drill(props => props.cb());
|
||||
|
||||
enzyme.shallow(<App />).until(Child);
|
||||
@@ -0,0 +1,22 @@
|
||||
// Type definitions for @commercetools/enzyme-extensions 3.0
|
||||
// Project: https://github.com/commercetools/enzyme-extensions
|
||||
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as enzyme from 'enzyme';
|
||||
|
||||
declare module 'enzyme' {
|
||||
interface UntilOptions {
|
||||
maxDepth: number;
|
||||
}
|
||||
interface ShallowWrapper<P = {}> {
|
||||
renderProp(propName: string, ...args: any[]): ShallowWrapper<P>;
|
||||
drill(expander: (props: any) => ShallowWrapper): ShallowWrapper<P>;
|
||||
until(selector: EnzymeSelector, options?: UntilOptions): ShallowWrapper<P>;
|
||||
}
|
||||
}
|
||||
|
||||
declare function monkeyPatchShallowWrapper(s: typeof enzyme.ShallowWrapper): void;
|
||||
|
||||
export = monkeyPatchShallowWrapper;
|
||||
+6
-12
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
@@ -17,17 +16,12 @@
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true
|
||||
"paths": {
|
||||
"@commercetools/enzyme-extensions": ["commercetools__enzyme-extensions"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/react-i18next-tests.tsx",
|
||||
"src/context.d.ts",
|
||||
"src/I18n.d.ts",
|
||||
"src/I18nextProvider.d.ts",
|
||||
"src/interpolate.d.ts",
|
||||
"src/loadNamespaces.d.ts",
|
||||
"src/trans.d.ts",
|
||||
"src/translate.d.ts"
|
||||
"commercetools__enzyme-extensions-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
@@ -625,6 +625,7 @@ declare namespace Consul {
|
||||
dc?: string;
|
||||
tag?: string;
|
||||
passing?: boolean;
|
||||
near?: string;
|
||||
}
|
||||
|
||||
interface StateOptions extends CommonOptions {
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
let BluetoothClassicSerial: BluetoothClassicSerial =
|
||||
window.BluetoothClassicSerial;
|
||||
|
||||
BluetoothClassicSerial.connect(
|
||||
"",
|
||||
[""]
|
||||
);
|
||||
BluetoothClassicSerial.connect(
|
||||
"",
|
||||
[""],
|
||||
results => {}
|
||||
);
|
||||
BluetoothClassicSerial.connect(
|
||||
"",
|
||||
[""],
|
||||
results => {},
|
||||
error => {}
|
||||
);
|
||||
BluetoothClassicSerial.connectInsecure("", [""]);
|
||||
BluetoothClassicSerial.connectInsecure("", [""], results => {});
|
||||
BluetoothClassicSerial.connectInsecure("", [""], results => {}, error => {});
|
||||
BluetoothClassicSerial.register(() => {});
|
||||
BluetoothClassicSerial.disconnect(results => {});
|
||||
BluetoothClassicSerial.disconnect(results => {}, error => {});
|
||||
BluetoothClassicSerial.write("", "");
|
||||
BluetoothClassicSerial.write("", "", results => {});
|
||||
BluetoothClassicSerial.write("", "", results => {}, error => {});
|
||||
BluetoothClassicSerial.available("");
|
||||
BluetoothClassicSerial.available("", results => {});
|
||||
BluetoothClassicSerial.available("", results => {}, error => {});
|
||||
BluetoothClassicSerial.read("");
|
||||
BluetoothClassicSerial.read("", results => {});
|
||||
BluetoothClassicSerial.read("", results => {}, error => {});
|
||||
BluetoothClassicSerial.readUntil("", "");
|
||||
BluetoothClassicSerial.readUntil("", "", results => {});
|
||||
BluetoothClassicSerial.readUntil("", "", results => {}, error => {});
|
||||
BluetoothClassicSerial.subscribe("", "");
|
||||
BluetoothClassicSerial.subscribe("", "", results => {});
|
||||
BluetoothClassicSerial.subscribe("", "", results => {}, error => {});
|
||||
BluetoothClassicSerial.unsubscribe("");
|
||||
BluetoothClassicSerial.unsubscribe("", results => {});
|
||||
BluetoothClassicSerial.unsubscribe("", results => {}, error => {});
|
||||
BluetoothClassicSerial.subscribeRawData("");
|
||||
BluetoothClassicSerial.subscribeRawData("", results => {});
|
||||
BluetoothClassicSerial.subscribeRawData("", results => {}, error => {});
|
||||
BluetoothClassicSerial.unsubscribeRawData("");
|
||||
BluetoothClassicSerial.unsubscribeRawData("", results => {});
|
||||
BluetoothClassicSerial.unsubscribeRawData("", results => {}, error => {});
|
||||
BluetoothClassicSerial.clear("");
|
||||
BluetoothClassicSerial.clear("", results => {});
|
||||
BluetoothClassicSerial.clear("", results => {}, error => {});
|
||||
BluetoothClassicSerial.list(results => {});
|
||||
BluetoothClassicSerial.list(results => {}, error => {});
|
||||
BluetoothClassicSerial.isConnected(results => {});
|
||||
BluetoothClassicSerial.isConnected(results => {}, error => {});
|
||||
BluetoothClassicSerial.isEnabled(results => {});
|
||||
BluetoothClassicSerial.isEnabled(results => {}, error => {});
|
||||
BluetoothClassicSerial.showBluetoothSettings(results => {});
|
||||
BluetoothClassicSerial.showBluetoothSettings(results => {}, error => {});
|
||||
BluetoothClassicSerial.enable(results => {});
|
||||
BluetoothClassicSerial.enable(results => {}, error => {});
|
||||
BluetoothClassicSerial.discoverUnpaired(results => {});
|
||||
BluetoothClassicSerial.discoverUnpaired(results => {}, error => {});
|
||||
@@ -0,0 +1,105 @@
|
||||
// Type definitions for cordova-plugin-bluetoothClassic-serial 0.9
|
||||
// Project: https://github.com/soltius/BluetoothClassicSerial
|
||||
// Definitions by: Wouter Roosendaal <https://github.com/tuvokki>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Global object bluetoothClassicSerial.
|
||||
*/
|
||||
interface Window {
|
||||
BluetoothClassicSerial: BluetoothClassicSerial;
|
||||
}
|
||||
|
||||
interface BluetoothClassicSerial {
|
||||
connect: (
|
||||
deviceId: string,
|
||||
interfaceArray: [any],
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
connectInsecure: (
|
||||
deviceId: string,
|
||||
interfaceArray: [any],
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
register: (data_cb?: () => any) => void;
|
||||
disconnect: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
write: (
|
||||
interfaceId: string,
|
||||
data: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
available: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
read: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
readUntil: (
|
||||
interfaceId: string,
|
||||
delimiter: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
subscribe: (
|
||||
interfaceId: string,
|
||||
delimiter: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
unsubscribe: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
subscribeRawData: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
unsubscribeRawData: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
clear: (
|
||||
interfaceId: string,
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
list: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
isConnected: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
isEnabled: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
showBluetoothSettings: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
enable: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
discoverUnpaired: (
|
||||
success_cb?: (results: any) => any,
|
||||
fail_cb?: (error: any) => any
|
||||
) => void;
|
||||
}
|
||||
|
||||
declare var bluetoothClassicSerial: BluetoothClassicSerial;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-plugin-bluetoothclassic-serial-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import crpc from 'crpc';
|
||||
|
||||
const client = crpc('https://example.com/');
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for crpc 0.2
|
||||
// Project: https://github.com/billinghamj/crpc
|
||||
// Definitions by: Alexander Forbes-Reed <https://github.com/0xdeafcafe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
export type Client = <TRes>(path: string, body: any, options?: {} | null) => Promise<TRes>;
|
||||
|
||||
export default function crpc(baseUrl: string, options?: {}): Client;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"crpc-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,8 @@ const showAllStyle: cytoscape.Stylesheet[] = [
|
||||
'text-halign': 'center',
|
||||
shape: 'rectangle',
|
||||
'min-zoomed-font-size': 20,
|
||||
opacity: 1
|
||||
opacity: 1,
|
||||
width: 'mapData(weight, 40, 80, 20, 60)'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -125,7 +126,7 @@ cy.on('zoom', (event) => {
|
||||
cy.off('zoom');
|
||||
// events(cy); - TODO
|
||||
|
||||
cy.add({ data: { id: 'g' }, position: {x: 200, y: 150} });
|
||||
cy.add({ data: { id: 'g', someOtherKey: 'value' }, position: {x: 200, y: 150} });
|
||||
cy.add([
|
||||
{ data: { id: 'h' }, position: {x: 250, y: 100} }
|
||||
]);
|
||||
|
||||
Vendored
+9
-3
@@ -133,6 +133,8 @@ declare namespace cytoscape {
|
||||
}
|
||||
|
||||
interface EdgeDataDefinition extends ElementDataDefinition {
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* the source node id (edge comes from this node)
|
||||
*/
|
||||
@@ -141,6 +143,8 @@ declare namespace cytoscape {
|
||||
* the target node id (edge goes to this node)
|
||||
*/
|
||||
target: string;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface NodeDefinition extends ElementDefinition {
|
||||
@@ -148,7 +152,9 @@ declare namespace cytoscape {
|
||||
}
|
||||
|
||||
interface NodeDataDefinition extends ElementDataDefinition {
|
||||
id?: string;
|
||||
parent?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface CytoscapeOptions {
|
||||
@@ -3445,13 +3451,13 @@ declare namespace cytoscape {
|
||||
* This property can take on the special value label
|
||||
* so the width is automatically based on the node’s label.
|
||||
*/
|
||||
"width"?: number | "label";
|
||||
"width"?: number | string;
|
||||
/**
|
||||
* The height of the node’s body.
|
||||
* This property can take on the special value label
|
||||
* so the height is automatically based on the node’s label.
|
||||
*/
|
||||
"height"?: number | "label";
|
||||
"height"?: number | string;
|
||||
/**
|
||||
* The shape of the node’s body.
|
||||
*/
|
||||
@@ -3624,7 +3630,7 @@ declare namespace cytoscape {
|
||||
/**
|
||||
* The width of an edge’s line.
|
||||
*/
|
||||
"width"?: number | "label";
|
||||
"width"?: number | string;
|
||||
/**
|
||||
* The curving method used to separate two or more edges between two nodes;
|
||||
* may be
|
||||
|
||||
@@ -9,6 +9,7 @@ tracer.init({
|
||||
debug: msg => {},
|
||||
error: err => {},
|
||||
},
|
||||
tags: { tracerEnv: 'dev'}
|
||||
});
|
||||
|
||||
function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") {
|
||||
|
||||
Vendored
+5
@@ -110,6 +110,11 @@ interface TracerOptions {
|
||||
debug: (message: string) => void;
|
||||
error: (err: Error) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Global tags that should be assigned to every span.
|
||||
*/
|
||||
tags?: { [key: string]: any };
|
||||
}
|
||||
|
||||
interface ExperimentalOptions {}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { diff, observableDiff, applyChange, Diff } from 'deep-diff';
|
||||
|
||||
|
||||
import _deepDiff = require('deep-diff');
|
||||
var diff = _deepDiff.diff;
|
||||
|
||||
var lhs = {
|
||||
let lhs = {
|
||||
name: 'my object',
|
||||
description: 'it\'s an object!',
|
||||
details: {
|
||||
@@ -13,7 +10,7 @@ var lhs = {
|
||||
}
|
||||
};
|
||||
|
||||
var rhs = {
|
||||
let rhs = {
|
||||
name: 'updated object',
|
||||
description: 'it\'s an object!',
|
||||
details: {
|
||||
@@ -23,17 +20,13 @@ var rhs = {
|
||||
}
|
||||
};
|
||||
|
||||
var differences: deepDiff.IDiff[] = diff(lhs, rhs);
|
||||
const differences: Array<Diff<any>> = diff(lhs, rhs);
|
||||
|
||||
console.log(differences);
|
||||
|
||||
|
||||
// --------------------------
|
||||
|
||||
var observableDiff = _deepDiff.observableDiff;
|
||||
var applyChange = _deepDiff.applyChange;
|
||||
|
||||
var lhs = {
|
||||
lhs = {
|
||||
name: 'my object',
|
||||
description: 'it\'s an object!',
|
||||
details: {
|
||||
@@ -43,7 +36,7 @@ var lhs = {
|
||||
}
|
||||
};
|
||||
|
||||
var rhs = {
|
||||
rhs = {
|
||||
name: 'updated object',
|
||||
description: 'it\'s an object!',
|
||||
details: {
|
||||
@@ -53,7 +46,7 @@ var rhs = {
|
||||
}
|
||||
};
|
||||
|
||||
observableDiff(lhs, rhs, function (d: deepDiff.IDiff) {
|
||||
observableDiff(lhs, rhs, d => {
|
||||
// Apply all changes except those to the 'name' property...
|
||||
if (d.path.length !== 1 || d.path.join('.') !== 'name') {
|
||||
applyChange(lhs, rhs, d);
|
||||
|
||||
Vendored
+53
-35
@@ -1,42 +1,60 @@
|
||||
// Type definitions for deep-diff
|
||||
// Type definitions for deep-diff 1.0
|
||||
// Project: https://github.com/flitbit/diff/
|
||||
// Definitions by: ZauberNerd <https://github.com/ZauberNerd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare namespace deepDiff {
|
||||
interface IDiff {
|
||||
kind: string;
|
||||
path: string[];
|
||||
lhs: any;
|
||||
rhs: any;
|
||||
index?: number;
|
||||
item?: IDiff;
|
||||
}
|
||||
|
||||
interface IAccumulator {
|
||||
push(diff: IDiff): void;
|
||||
length: number;
|
||||
}
|
||||
|
||||
interface IPrefilter {
|
||||
(path: string[], key: string): boolean;
|
||||
}
|
||||
|
||||
interface IDeepDiff {
|
||||
diff(lhs: Object, rhs: Object, prefilter?: IPrefilter, acc?: IAccumulator): IDiff[];
|
||||
diff(): IDiff;
|
||||
observableDiff(lhs: Object, rhs: Object, changes: Function, prefilter?: IPrefilter, path?: string[], key?: string, stack?: Object[]): void;
|
||||
applyDiff(target: Object, source: Object, filter: Function): void;
|
||||
applyChange(target: Object, source: Object, change: IDiff): void;
|
||||
revertChange(target: Object, source: Object, change: IDiff): void;
|
||||
isConflict(): boolean;
|
||||
noConflict(): IDeepDiff;
|
||||
}
|
||||
export interface DiffNew<RHS> {
|
||||
kind: 'N';
|
||||
path?: any[];
|
||||
rhs: RHS;
|
||||
}
|
||||
|
||||
declare var DeepDiff: deepDiff.IDeepDiff;
|
||||
|
||||
declare module "deep-diff" {
|
||||
var diff: deepDiff.IDeepDiff;
|
||||
export = diff;
|
||||
export interface DiffDeleted<LHS> {
|
||||
kind: 'D';
|
||||
path?: any[];
|
||||
lhs: LHS;
|
||||
}
|
||||
|
||||
export interface DiffEdit<LHS, RHS = LHS> {
|
||||
kind: 'E';
|
||||
path?: any[];
|
||||
lhs: LHS;
|
||||
rhs: RHS;
|
||||
}
|
||||
|
||||
export interface DiffArray<LHS, RHS = LHS> {
|
||||
kind: 'A';
|
||||
path?: any[];
|
||||
index: number;
|
||||
item: Diff<LHS, RHS>;
|
||||
}
|
||||
|
||||
export type Diff<LHS, RHS = LHS> = DiffNew<RHS> | DiffDeleted<LHS> | DiffEdit<LHS, RHS> | DiffArray<LHS, RHS>;
|
||||
|
||||
export type PreFilterFunction = (path: any[], key: any) => boolean;
|
||||
export interface PreFilterObject<LHS, RHS = LHS> {
|
||||
prefilter?(path: any[], key: any): boolean;
|
||||
normalize?(currentPath: any, key: any, lhs: LHS, rhs: RHS): [ LHS, RHS ] | undefined;
|
||||
}
|
||||
export type PreFilter<LHS, RHS = LHS> = PreFilterFunction | PreFilterObject<LHS, RHS>;
|
||||
|
||||
export interface Accumulator<LHS, RHS = LHS> {
|
||||
push(diff: Diff<LHS, RHS>): void;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export type Observer<LHS, RHS = LHS> = (diff: Diff<LHS, RHS>) => void;
|
||||
|
||||
export type Filter<LHS, RHS = LHS> = (target: LHS, source: RHS, change: Diff<LHS, RHS>) => boolean;
|
||||
|
||||
export function diff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>): Array<Diff<LHS, RHS>> | undefined;
|
||||
export function diff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>, acc?: Accumulator<LHS, RHS>): Accumulator<LHS, RHS>;
|
||||
export function orderIndependentDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>): Array<Diff<LHS, RHS>> | undefined;
|
||||
export function orderIndependentDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>, acc?: Accumulator<LHS, RHS>): Accumulator<LHS, RHS>;
|
||||
export function observableDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, observer?: Observer<LHS, RHS>, prefilter?: PreFilter<LHS, RHS>, orderIndependent?: boolean): Array<Diff<LHS, RHS>>;
|
||||
export function orderIndependentDeepDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, changes: Array<Diff<LHS, RHS>>, prefilter: PreFilter<LHS, RHS>, path: any[], key: any, stack: any[]): void;
|
||||
export function orderIndepHash(object: any): number;
|
||||
export function applyDiff<LHS, RHS = LHS>(target: LHS, source: RHS, filter?: Filter<LHS, RHS>): void;
|
||||
export function applyChange<LHS>(target: LHS, source: any, change: Diff<LHS, any>): void;
|
||||
export function revertChange<LHS>(target: LHS, source: any, change: Diff<LHS, any>): void;
|
||||
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import detective = require("detective");
|
||||
|
||||
const opts: detective.Options = {
|
||||
parse: {
|
||||
sourceType: "module",
|
||||
allowImportExportEverywhere: true
|
||||
}
|
||||
};
|
||||
|
||||
detective("content", opts).filter((x) => x && x.length > 0);
|
||||
|
||||
const detectiveFunc: detective.Detective = detective;
|
||||
|
||||
detectiveFunc.find("str").strings.forEach((dep) => {
|
||||
const b: boolean = dep[0] === '.';
|
||||
});
|
||||
Vendored
+106
@@ -0,0 +1,106 @@
|
||||
// Type definitions for detective 5.1
|
||||
// Project: https://github.com/browserify/detective
|
||||
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as acorn from "acorn";
|
||||
|
||||
/**
|
||||
* Find all calls to require() by walking the AST
|
||||
*/
|
||||
declare namespace detective {
|
||||
interface Detective {
|
||||
/**
|
||||
* Give some source body src, return an array of all the require() calls with string arguments.
|
||||
* The options parameter opts is passed along to detective.find().
|
||||
*/
|
||||
(src: string, opts?: Options): string[];
|
||||
/**
|
||||
* Give some source body 'src', return 'found' DetectiveResults
|
||||
*/
|
||||
find(src: string, opts?: Options): DetectiveResults;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* specify a different function name instead of "require"
|
||||
*/
|
||||
word?: string;
|
||||
/**
|
||||
* when true, populate found.nodes
|
||||
*/
|
||||
nodes?: string;
|
||||
/**
|
||||
* a function returning whether an AST CallExpression node is a require call
|
||||
*/
|
||||
isRequire?: (node: any) => boolean;
|
||||
/**
|
||||
* supply options directly to acorn with some support for esprima-style options range and loc
|
||||
*/
|
||||
parse?: acorn.Options;
|
||||
/**
|
||||
* Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015),
|
||||
* 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial support). This influences
|
||||
* support for strict mode, the set of reserved words, and support for new syntax features.
|
||||
* Default is 9.
|
||||
*/
|
||||
ecmaVersion?: string | number;
|
||||
|
||||
/**
|
||||
* If false, using a reserved word will generate an error. Defaults to true for ecmaVersion 3,
|
||||
* false for higher versions. When given the value "never", reserved words and keywords can
|
||||
* also not be used as property names (as in Internet Explorer's old parser).
|
||||
*/
|
||||
allowReserved?: boolean | "never";
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error. Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
/**
|
||||
* When this is enabled (off by default), if the code starts with the
|
||||
* characters #! (as in a shellscript), the first line will be treated as a comment.
|
||||
*/
|
||||
allowHashBang?: boolean;
|
||||
/**
|
||||
* When true, each node has a loc object attached with start and end subobjects, each of which
|
||||
* contains the one-based line and zero-based column numbers in {line, column} form. Default is false.
|
||||
*/
|
||||
locations?: boolean;
|
||||
/**
|
||||
* Nodes have their start and end characters offsets recorded in start and end properties
|
||||
* (directly on the node, rather than the loc object, which holds line/column data.
|
||||
* To also add a semi-standardized range property holding a [start, end] array with
|
||||
* the same numbers, set the ranges option to true.
|
||||
*/
|
||||
ranges?: string;
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in. Can be either "script" or "module".
|
||||
* This influences global strict mode and parsing of import and export declarations.
|
||||
*/
|
||||
sourceType?: ("script" | "module");
|
||||
}
|
||||
|
||||
interface DetectiveResults {
|
||||
/**
|
||||
* an array of each string found in a require()
|
||||
*/
|
||||
strings: string[];
|
||||
/**
|
||||
* an array of each stringified expression found in a require() call
|
||||
*/
|
||||
expressions: string[];
|
||||
/**
|
||||
* (when opts.nodes === true) - an array of AST nodes for each argument found in a require() call
|
||||
*/
|
||||
nodes?: any[];
|
||||
}
|
||||
}
|
||||
|
||||
declare var detective: detective.Detective;
|
||||
|
||||
export = detective;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"detective-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -16,6 +16,29 @@ diffArraysResult.forEach(result => {
|
||||
}
|
||||
});
|
||||
|
||||
interface DiffObj {
|
||||
value: number;
|
||||
}
|
||||
const a: DiffObj = {value: 0};
|
||||
const b: DiffObj = {value: 1};
|
||||
const c: DiffObj = {value: 2};
|
||||
const d: DiffObj = {value: 3};
|
||||
const arrayOptions: jsdiff.IArrayOptions = {
|
||||
comparator: (left: DiffObj, right: DiffObj) => {
|
||||
return left.value === right.value;
|
||||
}
|
||||
};
|
||||
const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions);
|
||||
diffResult.forEach(result => {
|
||||
if (result.added) {
|
||||
console.log(`added ${result.value.length} line(s):`, ...result.value);
|
||||
} else if (result.removed) {
|
||||
console.log(`removed ${result.value.length} line(s):`, ...result.value);
|
||||
} else {
|
||||
console.log(`no changes`);
|
||||
}
|
||||
});
|
||||
|
||||
// --------------------------
|
||||
|
||||
class LineDiffWithoutWhitespace extends jsdiff.Diff {
|
||||
|
||||
Vendored
+3
-2
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/kpdecker/jsdiff
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// szdc <https://github.com/szdc>
|
||||
// moc-yuto <https://github.com/moc-yuto>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -18,8 +19,8 @@ declare namespace JsDiff {
|
||||
newlineIsToken?: boolean;
|
||||
}
|
||||
|
||||
interface IArrayOptions extends IOptions {
|
||||
comparator?: (left: any, right: any) => number;
|
||||
interface IArrayOptions {
|
||||
comparator?: (left: any, right: any) => boolean;
|
||||
}
|
||||
|
||||
interface IDiffResult {
|
||||
|
||||
Vendored
+31
-2
@@ -823,6 +823,35 @@ declare namespace Dockerode {
|
||||
context: string;
|
||||
src: string[];
|
||||
}
|
||||
|
||||
interface DockerVersion {
|
||||
ApiVersion: string;
|
||||
Arch: string;
|
||||
BuildTime: Date;
|
||||
Components: Array<{
|
||||
Details: {
|
||||
ApiVersion: string;
|
||||
Arch: string;
|
||||
BuilTime: Date;
|
||||
Experimental: string;
|
||||
GitCommit: string;
|
||||
GoVersion: string;
|
||||
KernelVersion: string;
|
||||
Os: string;
|
||||
};
|
||||
Name: string;
|
||||
Version: string;
|
||||
}>;
|
||||
GitCommit: string;
|
||||
GoVersion: string;
|
||||
KernelVersion: string;
|
||||
MinAPIVersion: string;
|
||||
Os: string;
|
||||
Platform: {
|
||||
Name: string;
|
||||
};
|
||||
Version: string;
|
||||
}
|
||||
}
|
||||
|
||||
type Callback<T> = (error?: any, result?: T) => void;
|
||||
@@ -949,8 +978,8 @@ declare class Dockerode {
|
||||
df(callback: Callback<any>): void;
|
||||
df(): Promise<any>;
|
||||
|
||||
version(callback: Callback<any>): void;
|
||||
version(): Promise<any>;
|
||||
version(callback: Callback<Dockerode.DockerVersion>): void;
|
||||
version(): Promise<Dockerode.DockerVersion>;
|
||||
|
||||
ping(callback: Callback<any>): void;
|
||||
ping(): Promise<any>;
|
||||
|
||||
Vendored
+3
-3
@@ -2855,7 +2855,7 @@ declare module dijit {
|
||||
get(property:"ownerDocument"): Object;
|
||||
watch(property:"ownerDocument", callback:{(property?:string, oldValue?:Object, newValue?: Object):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -6801,7 +6801,7 @@ declare module dijit {
|
||||
get(property:"searchContainerNode"): boolean;
|
||||
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -104923,7 +104923,7 @@ declare module dijit {
|
||||
get(property:"searchContainerNode"): boolean;
|
||||
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
|
||||
Vendored
+5
-5
@@ -17225,7 +17225,7 @@ declare namespace dojox {
|
||||
get(property:"searchContainerNode"): boolean;
|
||||
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -18171,7 +18171,7 @@ declare namespace dojox {
|
||||
get(property:"searchContainerNode"): boolean;
|
||||
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -23352,7 +23352,7 @@ declare namespace dojox {
|
||||
get(property:"refreshOnShow"): boolean;
|
||||
watch(property: "refreshOnShow", callback: { (property?: string, oldValue?: boolean, newValue?: boolean): void }): { unwatch(): void }
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -24411,7 +24411,7 @@ declare namespace dojox {
|
||||
get(property:"ownerDocument"): Object;
|
||||
watch(property:"ownerDocument", callback:{(property?:string, oldValue?:Object, newValue?: Object):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
@@ -25307,7 +25307,7 @@ declare namespace dojox {
|
||||
get(property:"searchContainerNode"): boolean;
|
||||
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
|
||||
/**
|
||||
* A parameter needed by RadioGroupSlide only. An optional paramter to force
|
||||
* A parameter needed by RadioGroupSlide only. An optional parameter to force
|
||||
* the ContentPane to slide in from a set direction. Defaults
|
||||
* to "random", or specify one of "top", "left", "right", "bottom"
|
||||
* to slideFrom top, left, right, or bottom.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import domLoaded = require("dom-loaded");
|
||||
|
||||
domLoaded.then(() => console.log("DOM is loaded"));
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for dom-loaded 1.0
|
||||
// Project: https://github.com/sindresorhus/dom-loaded#readme
|
||||
// Definitions by: Lukas Tetzlaf <https://github.com/ltetzlaff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare const domLoaded: Promise<void>;
|
||||
export = domLoaded;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dom-loaded-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+16
-1
@@ -1,10 +1,14 @@
|
||||
// Type definitions for DOM Purify
|
||||
// Project: https://github.com/cure53/DOMPurify
|
||||
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>
|
||||
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>, FlowCrypt <https://github.com/FlowCrypt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace DOMPurify;
|
||||
|
||||
export declare let version: string;
|
||||
export declare let removed: any[];
|
||||
export declare let isSupported: boolean;
|
||||
|
||||
export declare function sanitize(source: string | Node): string;
|
||||
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT?: false; RETURN_DOM?: false; }): string;
|
||||
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT: true; }): DocumentFragment;
|
||||
@@ -13,6 +17,12 @@ export declare function sanitize(source: string | Node, config: Config): string
|
||||
export declare function addHook(hook: 'uponSanitizeElement', cb: (currentNode: Element, data: SanitizeElementHookEvent, config: Config) => void): void;
|
||||
export declare function addHook(hook: 'uponSanitizeAttribute', cb: (currentNode: Element, data: SanitizeAttributeHookEvent, config: Config) => void): void;
|
||||
export declare function addHook(hook: HookName, cb: (currentNode: Element, data: HookEvent, config: Config) => void): void;
|
||||
export declare function setConfig(cfg: Config): void;
|
||||
export declare function clearConfig(): void;
|
||||
export declare function isValidAttribute(tag: string, attr: string, value: string): boolean;
|
||||
export declare function removeHook(entryPoint: HookName): void;
|
||||
export declare function removeHooks(entryPoint: HookName): void;
|
||||
export declare function removeAllHooks(): void;
|
||||
|
||||
interface Config {
|
||||
ADD_ATTR?: string[];
|
||||
@@ -30,6 +40,11 @@ interface Config {
|
||||
SAFE_FOR_JQUERY?: boolean;
|
||||
SANITIZE_DOM?: boolean;
|
||||
WHOLE_DOCUMENT?: boolean;
|
||||
ALLOWED_URI_REGEXP?: RegExp;
|
||||
SAFE_FOR_TEMPLATES?: boolean;
|
||||
ALLOW_UNKNOWN_PROTOCOLS?: boolean;
|
||||
USE_PROFILES?: false | {mathMl?: boolean, svg?: boolean, svgFilters?: boolean, html?: boolean};
|
||||
IN_PLACE?: boolean;
|
||||
}
|
||||
|
||||
type HookName
|
||||
|
||||
@@ -41,7 +41,7 @@ googletag.openConsole();
|
||||
|
||||
googletag.setAdIframeTitle("title");
|
||||
|
||||
googletag.cmd.push(function() {
|
||||
googletag.cmd.push(() => {
|
||||
googletag.defineSlot("/1234567/sports", [160, 600]).
|
||||
addService(googletag.pubads());
|
||||
});
|
||||
@@ -79,8 +79,8 @@ googletag.pubads().definePassback("/1234567/sports", [468, 60]).
|
||||
display();
|
||||
|
||||
googletag.pubads().definePassback("/1234567/sports", [160, 600]).
|
||||
updateTargetingFromMap({"color": "red",
|
||||
"interests": ["sports", "music", "movies"]}).
|
||||
updateTargetingFromMap({color: "red",
|
||||
interests: ["sports", "music", "movies"]}).
|
||||
display();
|
||||
|
||||
googletag.pubads().enableLazyLoad();
|
||||
@@ -262,7 +262,7 @@ googletag.pubads().updateCorrelator();
|
||||
// The listener will be called only when the pubads service renders a slot.
|
||||
// To listen to companion ads, add a similar listener to
|
||||
// googletag.companionAds().
|
||||
googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag.events.SlotRenderEndedEvent) {
|
||||
googletag.pubads().addEventListener("slotRenderEnded", (event: googletag.events.SlotRenderEndedEvent) => {
|
||||
console.log("Slot has been rendered:");
|
||||
console.log(event);
|
||||
});
|
||||
@@ -273,7 +273,7 @@ googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag
|
||||
// however, programmatically filter a listener to respond only to a certain
|
||||
// ad slot, using this pattern:
|
||||
let targetSlot = slot1;
|
||||
googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag.events.SlotRenderEndedEvent) {
|
||||
googletag.pubads().addEventListener("slotRenderEnded", (event: googletag.events.SlotRenderEndedEvent) => {
|
||||
if (event.slot === targetSlot) {
|
||||
// Slot specific logic.
|
||||
}
|
||||
@@ -283,7 +283,7 @@ googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag
|
||||
// The listener will be called when the impression is considered viewable.
|
||||
// This event also operates at service level, but, as above, you can filter
|
||||
// to respond only to a certain ad slot by using this pattern:
|
||||
googletag.pubads().addEventListener("impressionViewable", function(event: googletag.events.ImpressionViewableEvent) {
|
||||
googletag.pubads().addEventListener("impressionViewable", (event: googletag.events.ImpressionViewableEvent) => {
|
||||
if (event.slot === targetSlot) {
|
||||
// Slot specific logic.
|
||||
}
|
||||
@@ -317,7 +317,6 @@ slot.clearCategoryExclusions();
|
||||
|
||||
// Make an ad request. Any ad can be returned for the slot.
|
||||
|
||||
|
||||
slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1").
|
||||
setTargeting("allow_expandable", "true").
|
||||
setTargeting("interests", ["sports", "music", "movies"]).
|
||||
|
||||
Vendored
+31
-30
@@ -1,29 +1,30 @@
|
||||
// Type definitions for Google Publisher Tag v238
|
||||
// Type definitions for Google Publisher Tag 238.0
|
||||
// Project: https://developers.google.com/doubleclick-gpt/reference
|
||||
// Definitions by: John Wright <https://github.com/johngeorgewright>
|
||||
// Steven Joyce <https://github.com/steven-joyce>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace googletag {
|
||||
export type SingleSizeArray = number[];
|
||||
type SingleSizeArray = number[];
|
||||
|
||||
export type NamedSize = string | string[];
|
||||
type NamedSize = string | string[];
|
||||
|
||||
export type SingleSize = SingleSizeArray | NamedSize;
|
||||
type SingleSize = SingleSizeArray | NamedSize;
|
||||
|
||||
export type MultiSize = SingleSize[];
|
||||
type MultiSize = SingleSize[];
|
||||
|
||||
export type GeneralSize = SingleSize | MultiSize;
|
||||
type GeneralSize = SingleSize | MultiSize;
|
||||
|
||||
export type SizeMapping = GeneralSize[];
|
||||
type SizeMapping = GeneralSize[];
|
||||
|
||||
export type SizeMappingArray = SizeMapping[];
|
||||
type SizeMappingArray = SizeMapping[];
|
||||
|
||||
export interface CommandArray {
|
||||
push(f: Function): number;
|
||||
interface CommandArray {
|
||||
push(f: () => void): number;
|
||||
}
|
||||
|
||||
export interface Service {
|
||||
interface Service {
|
||||
addEventListener(
|
||||
eventType: string,
|
||||
listener: (event: events.ImpressionViewableEvent | events.SlotOnloadEvent | events.SlotRenderEndedEvent | events.slotVisibilityChangedEvent) => void
|
||||
@@ -31,29 +32,29 @@ declare namespace googletag {
|
||||
getSlots(): Slot[];
|
||||
}
|
||||
|
||||
export interface CompanionAdsService extends Service {
|
||||
interface CompanionAdsService extends Service {
|
||||
enableSyncLoading(): void;
|
||||
setRefreshUnfilledSlots(value: boolean): void;
|
||||
}
|
||||
|
||||
export interface ContentService extends Service {
|
||||
setContent(slot: Slot, content: String): void;
|
||||
interface ContentService extends Service {
|
||||
setContent(slot: Slot, content: string): void;
|
||||
}
|
||||
|
||||
export interface LazyLoadOptionsConfig {
|
||||
fetchMarginPercent?: number,
|
||||
renderMarginPercent?: number,
|
||||
mobileScaling?: number
|
||||
interface LazyLoadOptionsConfig {
|
||||
fetchMarginPercent?: number;
|
||||
renderMarginPercent?: number;
|
||||
mobileScaling?: number;
|
||||
}
|
||||
|
||||
export interface ResponseInformation {
|
||||
interface ResponseInformation {
|
||||
advertiserId: string;
|
||||
campaignId: string;
|
||||
creativeId?: number;
|
||||
lineItemId?: number;
|
||||
}
|
||||
|
||||
export interface SafeFrameConfig {
|
||||
interface SafeFrameConfig {
|
||||
allowOverlayExpansion?: boolean;
|
||||
allowPushExpansion?: boolean;
|
||||
sandbox?: boolean;
|
||||
@@ -78,7 +79,7 @@ declare namespace googletag {
|
||||
sizeMapping(): SizeMappingBuilder;
|
||||
}
|
||||
|
||||
export interface Slot {
|
||||
interface Slot {
|
||||
addService(service: Service): Slot;
|
||||
clearCategoryExclusions(): Slot;
|
||||
clearTargeting(opt_key?: string): Slot;
|
||||
@@ -100,7 +101,7 @@ declare namespace googletag {
|
||||
setTargeting(key: string, value: string | string[]): Slot;
|
||||
}
|
||||
|
||||
export interface PassbackSlot {
|
||||
interface PassbackSlot {
|
||||
display(): void;
|
||||
get(key: string): string;
|
||||
set(key: string, value: string): PassbackSlot;
|
||||
@@ -109,10 +110,10 @@ declare namespace googletag {
|
||||
setTagForChildDirectedTreatment(value: number): PassbackSlot;
|
||||
setTagForUnderAgeOfConsent(value: number): PassbackSlot;
|
||||
setTargeting(key: string, value: string | string[]): PassbackSlot;
|
||||
updateTargetingFromMap(map: Object): PassbackSlot;
|
||||
updateTargetingFromMap(map: object): PassbackSlot;
|
||||
}
|
||||
|
||||
export interface PubAdsService extends Service {
|
||||
interface PubAdsService extends Service {
|
||||
clear(opt_slots?: Slot[]): boolean;
|
||||
clearCategoryExclusions(): PubAdsService;
|
||||
clearTagForChildDirectedTreatment(): PubAdsService;
|
||||
@@ -148,23 +149,23 @@ declare namespace googletag {
|
||||
updateCorrelator(): PubAdsService;
|
||||
}
|
||||
|
||||
export interface SizeMappingBuilder {
|
||||
interface SizeMappingBuilder {
|
||||
addSize(viewportSize: SingleSizeArray, slotSize: GeneralSize): SizeMappingBuilder;
|
||||
build(): SizeMappingArray;
|
||||
}
|
||||
|
||||
export namespace events {
|
||||
export interface ImpressionViewableEvent {
|
||||
namespace events {
|
||||
interface ImpressionViewableEvent {
|
||||
serviceName: string;
|
||||
slot: Slot;
|
||||
}
|
||||
|
||||
export interface SlotOnloadEvent {
|
||||
interface SlotOnloadEvent {
|
||||
serviceName: string;
|
||||
slot: Slot;
|
||||
}
|
||||
|
||||
export interface SlotRenderEndedEvent {
|
||||
interface SlotRenderEndedEvent {
|
||||
advertiserId?: number;
|
||||
creativeId?: number;
|
||||
isEmpty: boolean;
|
||||
@@ -176,7 +177,7 @@ declare namespace googletag {
|
||||
sourceAgnosticLineItemId?: number;
|
||||
}
|
||||
|
||||
export interface slotVisibilityChangedEvent {
|
||||
interface slotVisibilityChangedEvent {
|
||||
inViewPercentage: number;
|
||||
serviceName: string;
|
||||
slot: Slot;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
@@ -22,4 +21,4 @@
|
||||
"index.d.ts",
|
||||
"doubleclick-gpt-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user