mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-10 12:10:18 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -726,6 +726,12 @@
|
||||
"sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "i18next-browser-languagedetector",
|
||||
"typingsPackageName": "i18next-browser-languagedetector",
|
||||
"sourceRepoURL": "https://github.com/i18next/i18next-browser-languagedetector",
|
||||
"asOfVersion": "2.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "i18next-xhr-backend",
|
||||
"typingsPackageName": "i18next-xhr-backend",
|
||||
@@ -1116,6 +1122,12 @@
|
||||
"sourceRepoURL": "http://onsen.io",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "p-throttle",
|
||||
"typingsPackageName": "p-throttle",
|
||||
"sourceRepoURL": "https://github.com/sindresorhus/p-throttle",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "param-case",
|
||||
"typingsPackageName": "param-case",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"lint": "dtslint types"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dtslint": "github:Microsoft/dtslint#production",
|
||||
"dtslint": "latest",
|
||||
"types-publisher": "github:Microsoft/types-publisher#production"
|
||||
},
|
||||
"dependencies": {}
|
||||
|
||||
@@ -97,6 +97,7 @@ let _algoliaIndexSettings: IndexSettings = {
|
||||
minProximity: 0,
|
||||
placeholders: { '': [''] },
|
||||
camelCaseAttributes: [''],
|
||||
sortFacetValuesBy: 'count',
|
||||
};
|
||||
|
||||
let _algoliaQueryParameters: QueryParameters = {
|
||||
@@ -150,6 +151,7 @@ let _algoliaQueryParameters: QueryParameters = {
|
||||
synonyms: true,
|
||||
replaceSynonymsInHighlight: false,
|
||||
minProximity: 0,
|
||||
sortFacetValuesBy: 'alpha',
|
||||
};
|
||||
|
||||
let client: Client = algoliasearch('', '');
|
||||
|
||||
30
types/algoliasearch/index.d.ts
vendored
30
types/algoliasearch/index.d.ts
vendored
@@ -5,6 +5,7 @@
|
||||
// Aurélien Hervé <https://github.com/aherve>
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Kai Eichinger <https://github.com/keichinger>
|
||||
// Nery Ortez <https://github.com/neryortez>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -24,25 +25,25 @@ declare namespace algoliasearch {
|
||||
* Query on multiple index
|
||||
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
queries: {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: QueryParameters;
|
||||
}[],
|
||||
cb: (err: Error, res: MultiResponse) => void
|
||||
cb: (err: Error, res: MultiResponse<T>) => void
|
||||
): void;
|
||||
/**
|
||||
* Query on multiple index
|
||||
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
queries: {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: QueryParameters;
|
||||
}[]
|
||||
): Promise<MultiResponse>;
|
||||
): Promise<MultiResponse<T>>;
|
||||
/**
|
||||
* Query for facet values of a specific facet
|
||||
*/
|
||||
@@ -590,14 +591,14 @@ declare namespace algoliasearch {
|
||||
* Search in an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
*/
|
||||
search(params: QueryParameters): Promise<Response>;
|
||||
search<T=any>(params: QueryParameters): Promise<Response<T>>;
|
||||
/**
|
||||
* Search in an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
params: QueryParameters,
|
||||
cb: (err: Error, res: Response) => void
|
||||
cb: (err: Error, res: Response<T>) => void
|
||||
): void;
|
||||
/**
|
||||
* Search in an index
|
||||
@@ -1451,6 +1452,11 @@ declare namespace algoliasearch {
|
||||
|
||||
nbShards?: number;
|
||||
userData?: string | object;
|
||||
|
||||
/**
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
|
||||
*/
|
||||
sortFacetValuesBy?: 'count' | 'alpha';
|
||||
}
|
||||
|
||||
namespace SearchForFacetValues {
|
||||
@@ -1776,14 +1782,16 @@ declare namespace algoliasearch {
|
||||
https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/
|
||||
*/
|
||||
camelCaseAttributes?: string[];
|
||||
|
||||
sortFacetValuesBy?: 'count' | 'alpha';
|
||||
}
|
||||
|
||||
interface Response {
|
||||
interface Response<T=any> {
|
||||
/**
|
||||
* Contains all the hits matching the query
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hits: any[];
|
||||
hits: T[];
|
||||
/**
|
||||
* Current page
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
@@ -1842,8 +1850,8 @@ declare namespace algoliasearch {
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
results: Response[];
|
||||
interface MultiResponse<T=any> {
|
||||
results: Response<T>[];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
28
types/algoliasearch/lite/index.d.ts
vendored
28
types/algoliasearch/lite/index.d.ts
vendored
@@ -6,6 +6,7 @@
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Claas Brüggemann <https://github.com/ClaasBrueggemann>
|
||||
// Kai Eichinger <https://github.com/keichinger>
|
||||
// Nery Ortez <https://github.com/neryortez>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -25,25 +26,25 @@ declare namespace algoliasearch {
|
||||
* Query on multiple index
|
||||
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
queries: {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: QueryParameters;
|
||||
}[],
|
||||
cb: (err: Error, res: MultiResponse) => void
|
||||
cb: (err: Error, res: MultiResponse<T>) => void
|
||||
): void;
|
||||
/**
|
||||
* Query on multiple index
|
||||
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
queries: {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: QueryParameters;
|
||||
}[]
|
||||
): Promise<MultiResponse>;
|
||||
): Promise<MultiResponse<T>>;
|
||||
/**
|
||||
* Query for facet values of a specific facet
|
||||
*/
|
||||
@@ -109,15 +110,15 @@ declare namespace algoliasearch {
|
||||
* Search in an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
*/
|
||||
search(
|
||||
search<T=any>(
|
||||
params: QueryParameters,
|
||||
cb: (err: Error, res: Response) => void
|
||||
cb: (err: Error, res: Response<T>) => void
|
||||
): void;
|
||||
/**
|
||||
* Search in an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
*/
|
||||
search(params: QueryParameters): Promise<Response>;
|
||||
search<T=any>(params: QueryParameters): Promise<Response<T>>;
|
||||
/**
|
||||
* Search in an index
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/
|
||||
@@ -531,6 +532,11 @@ declare namespace algoliasearch {
|
||||
|
||||
nbShards?: number;
|
||||
userData?: string | object;
|
||||
|
||||
/**
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
|
||||
*/
|
||||
sortFacetValuesBy?: 'count' | 'alpha';
|
||||
}
|
||||
|
||||
namespace SearchForFacetValues {
|
||||
@@ -552,12 +558,12 @@ declare namespace algoliasearch {
|
||||
}
|
||||
}
|
||||
|
||||
interface Response {
|
||||
interface Response<T=any> {
|
||||
/**
|
||||
* Contains all the hits matching the query
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
*/
|
||||
hits: any[];
|
||||
hits: T[];
|
||||
/**
|
||||
* Current page
|
||||
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
|
||||
@@ -616,8 +622,8 @@ declare namespace algoliasearch {
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
results: Response[];
|
||||
interface MultiResponse<T=any> {
|
||||
results: Response<T>[];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
types/angular-material/index.d.ts
vendored
2
types/angular-material/index.d.ts
vendored
@@ -346,7 +346,7 @@ declare module 'angular' {
|
||||
interface IMenuService {
|
||||
close(): void;
|
||||
hide(response?: any, options?: any): IPromise<any>;
|
||||
open(event?: MouseEvent): void;
|
||||
open(event?: MouseEvent | JQueryEventObject): void;
|
||||
}
|
||||
|
||||
interface IColorPalette {
|
||||
|
||||
@@ -39,3 +39,59 @@ babel.transformFromAstAsync(parsedAst!, sourceCode, options).then(transformFromA
|
||||
const { code, map, ast } = transformFromAstAsyncResult!;
|
||||
const { body } = ast!.program;
|
||||
});
|
||||
|
||||
function checkOptions(_options: babel.TransformOptions) {}
|
||||
function checkConfigFunction(_config: babel.ConfigFunction) {}
|
||||
|
||||
checkOptions({ envName: 'banana' });
|
||||
// babel uses object destructuring default to provide the envName fallback so null is not allowed
|
||||
// $ExpectError
|
||||
checkOptions({ envName: null });
|
||||
checkOptions({ caller: { name: '@babel/register' } });
|
||||
checkOptions({ caller: { name: 'babel-jest', supportsStaticESM: false } });
|
||||
// don't add an index signature; users should augment the interface instead if they need to
|
||||
// $ExpectError
|
||||
checkOptions({ caller: { name: '', tomato: true } });
|
||||
checkOptions({ rootMode: 'upward-optional' });
|
||||
// $ExpectError
|
||||
checkOptions({ rootMode: 'potato' });
|
||||
|
||||
// $ExpectError
|
||||
checkConfigFunction(() => {});
|
||||
// you technically can do that though you probably shouldn't
|
||||
checkConfigFunction(() => ({}));
|
||||
checkConfigFunction(api => {
|
||||
api.assertVersion(7);
|
||||
api.assertVersion("^7.2");
|
||||
|
||||
api.cache.forever();
|
||||
api.cache.never();
|
||||
api.cache.using(() => true);
|
||||
api.cache.using(() => 1);
|
||||
api.cache.using(() => '1');
|
||||
api.cache.using(() => null);
|
||||
api.cache.using(() => undefined);
|
||||
// $ExpectError
|
||||
api.cache.using(() => ({}));
|
||||
api.cache.invalidate(() => 2);
|
||||
|
||||
// $ExpectType string
|
||||
api.env();
|
||||
|
||||
api.env('development');
|
||||
api.env(['production', 'test']);
|
||||
// $ExpectType 42
|
||||
api.env(name => 42);
|
||||
|
||||
// $ExpectType string
|
||||
api.version;
|
||||
|
||||
return {
|
||||
shouldPrintComment(comment) {
|
||||
// $ExpectType string
|
||||
comment;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
155
types/babel__core/index.d.ts
vendored
155
types/babel__core/index.d.ts
vendored
@@ -1,8 +1,9 @@
|
||||
// Type definitions for @babel/core 7.0
|
||||
// Type definitions for @babel/core 7.1
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Jessica Franco <https://github.com/Jessidhia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
@@ -54,6 +55,15 @@ export interface TransformOptions {
|
||||
*/
|
||||
root?: string | null;
|
||||
|
||||
/**
|
||||
* This option, combined with the "root" value, defines how Babel chooses its project root.
|
||||
* The different modes define different ways that Babel can process the "root" value to get
|
||||
* the final project root.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/options#rootmode
|
||||
*/
|
||||
rootMode?: 'root' | 'upward' | 'upward-optional';
|
||||
|
||||
/**
|
||||
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
|
||||
*
|
||||
@@ -82,7 +92,7 @@ export interface TransformOptions {
|
||||
*
|
||||
* Default: env vars
|
||||
*/
|
||||
envName?: string | null;
|
||||
envName?: string;
|
||||
|
||||
/**
|
||||
* Enable code generation
|
||||
@@ -112,6 +122,14 @@ export interface TransformOptions {
|
||||
*/
|
||||
cwd?: string | null;
|
||||
|
||||
/**
|
||||
* Utilities may pass a caller object to identify themselves to Babel and
|
||||
* pass capability-related flags for use by configs, presets and plugins.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/options#caller
|
||||
*/
|
||||
caller?: TransformCaller;
|
||||
|
||||
/**
|
||||
* This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }`
|
||||
* which will use those options when the `envName` is `production`
|
||||
@@ -284,6 +302,14 @@ export interface TransformOptions {
|
||||
wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null;
|
||||
}
|
||||
|
||||
export interface TransformCaller {
|
||||
// the only required property
|
||||
name: string;
|
||||
// e.g. set to true by `babel-loader` and false by `babel-jest`
|
||||
supportsStaticESM?: boolean;
|
||||
// augment this with a "declare module '@babel/core' { ... }" if you need more keys
|
||||
}
|
||||
|
||||
export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
|
||||
|
||||
/**
|
||||
@@ -528,4 +554,129 @@ export interface CreateConfigItemOptions {
|
||||
*/
|
||||
export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem;
|
||||
|
||||
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
|
||||
*/
|
||||
export interface ConfigAPI {
|
||||
/**
|
||||
* The version string for the Babel version that is loading the config file.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apiversion
|
||||
*/
|
||||
version: string;
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
||||
*/
|
||||
cache: SimpleCacheConfigurator;
|
||||
/**
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
||||
*/
|
||||
env: EnvFunction;
|
||||
// undocumented; currently hardcoded to return 'false'
|
||||
// async(): boolean
|
||||
/**
|
||||
* This API is used as a way to access the `caller` data that has been passed to Babel.
|
||||
* Since many instances of Babel may be running in the same process with different `caller` values,
|
||||
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
|
||||
*
|
||||
* The `caller` value is available as the first parameter of the callback function.
|
||||
* It is best used with something like this to toggle configuration behavior
|
||||
* based on a specific environment:
|
||||
*
|
||||
* @example
|
||||
* function isBabelRegister(caller?: { name: string }) {
|
||||
* return !!(caller && caller.name === "@babel/register")
|
||||
* }
|
||||
* api.caller(isBabelRegister)
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
|
||||
*/
|
||||
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions['caller']) => T): T;
|
||||
/**
|
||||
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
|
||||
* This API exposes a simple way to do that with:
|
||||
*
|
||||
* @example
|
||||
* api.assertVersion(7) // major version only
|
||||
* api.assertVersion("^7.2")
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
|
||||
*/
|
||||
assertVersion(versionRange: number | string): boolean;
|
||||
// NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
|
||||
// tokTypes: typeof tokTypes
|
||||
}
|
||||
|
||||
/**
|
||||
* JS configs are great because they can compute a config on the fly,
|
||||
* but the downside there is that it makes caching harder.
|
||||
* Babel wants to avoid re-executing the config function every time a file is compiled,
|
||||
* because then it would also need to re-execute any plugin and preset functions
|
||||
* referenced in that config.
|
||||
*
|
||||
* To avoid this, Babel expects users of config functions to tell it how to manage caching
|
||||
* within a config file.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
||||
*/
|
||||
export interface SimpleCacheConfigurator {
|
||||
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
|
||||
// (ever: boolean): void
|
||||
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
|
||||
/**
|
||||
* Permacache the computed config and never call the function again.
|
||||
*/
|
||||
forever(): void;
|
||||
/**
|
||||
* Do not cache this config, and re-execute the function every time.
|
||||
*/
|
||||
never(): void;
|
||||
/**
|
||||
* Any time the using callback returns a value other than the one that was expected,
|
||||
* the overall config function will be called again and a new entry will be added to the cache.
|
||||
*
|
||||
* @example
|
||||
* api.cache.using(() => process.env.NODE_ENV)
|
||||
*/
|
||||
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
||||
/**
|
||||
* Any time the using callback returns a value other than the one that was expected,
|
||||
* the overall config function will be called again and all entries in the cache will
|
||||
* be replaced with the result.
|
||||
*
|
||||
* @example
|
||||
* api.cache.invalidate(() => process.env.NODE_ENV)
|
||||
*/
|
||||
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
||||
}
|
||||
|
||||
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
|
||||
export type SimpleCacheKey = string | boolean | number | null | undefined;
|
||||
export type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
|
||||
|
||||
/**
|
||||
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
|
||||
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
|
||||
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
||||
*/
|
||||
export interface EnvFunction {
|
||||
/**
|
||||
* @returns the current `envName` string
|
||||
*/
|
||||
(): string;
|
||||
/**
|
||||
* @returns `true` if the `envName` is `===` any of the given strings
|
||||
*/
|
||||
(envName: string | ReadonlyArray<string>): boolean;
|
||||
// the official documentation is misleading for this one...
|
||||
// this just passes the callback to `cache.using` but with an additional argument.
|
||||
// it returns its result instead of necessarily returning a boolean.
|
||||
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions['envName']>) => T): T;
|
||||
}
|
||||
|
||||
export type ConfigFunction = (api: ConfigAPI) => TransformOptions;
|
||||
|
||||
export as namespace babel;
|
||||
|
||||
2
types/baidu-app/index.d.ts
vendored
2
types/baidu-app/index.d.ts
vendored
@@ -4287,7 +4287,7 @@ declare namespace swan {
|
||||
Methods,
|
||||
Props
|
||||
> = object &
|
||||
ComponentOptions<V, Data | ((this: V) => Data), Methods, Props> &
|
||||
ComponentOptions<V, Data, Methods, Props> &
|
||||
ThisType<CombinedInstance<V, Data, Methods, Readonly<Props>>>;
|
||||
|
||||
interface ComponentRelation<D = any, P = any> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
import CamlBuilder from 'camljs'
|
||||
|
||||
var caml = new CamlBuilder().Where()
|
||||
.Any(
|
||||
@@ -53,3 +53,37 @@ caml = CamlBuilder.Expression()
|
||||
.ToString();
|
||||
|
||||
caml = new CamlBuilder().Where().DateTimeField("Created").GreaterThan(new Date(Date.UTC(2013,0,1))).ToString();
|
||||
|
||||
// Aggregations and extended syntax of GroupBy
|
||||
var query = new CamlBuilder()
|
||||
.View(["Category", { count: "ID" }, { sum: "Amount" }])
|
||||
.Query()
|
||||
.GroupBy("Category", true, 100)
|
||||
.ToString();
|
||||
|
||||
// ContentTypeId field
|
||||
var query = new CamlBuilder()
|
||||
.Where()
|
||||
.TextField("Title").EqualTo("Document")
|
||||
.And()
|
||||
.ContentTypeIdField().BeginsWith("0x101")
|
||||
.ToString();
|
||||
|
||||
// joins
|
||||
var query = new CamlBuilder()
|
||||
.View(["Title", "Country", "Population"])
|
||||
.LeftJoin("Country", "Country").Select("y4r6", "Population")
|
||||
.Query()
|
||||
.Where()
|
||||
.NumberField("Population").LessThan(10)
|
||||
.ToString();
|
||||
|
||||
// RowLimit & Scope
|
||||
var camlBuilder1 = new CamlBuilder()
|
||||
.View(["ID", "Created"])
|
||||
.RowLimit(20, true)
|
||||
.Scope(CamlBuilder.ViewScope.RecursiveAll)
|
||||
.Query()
|
||||
.Where()
|
||||
.TextField("Title").BeginsWith("A")
|
||||
.ToString();
|
||||
|
||||
77
types/camljs/index.d.ts
vendored
77
types/camljs/index.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
// Type definitions for camljs
|
||||
// Project: http://camljs.codeplex.com
|
||||
// Definitions by: Andrey Markeev <http://markeev.com>
|
||||
// Project: https://github.com/andrei-markeev/camljs
|
||||
// Definitions by: Andrey Markeev <https://github.com/andrei-markeev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
declare class CamlBuilder {
|
||||
constructor();
|
||||
@@ -10,25 +10,43 @@ declare class CamlBuilder {
|
||||
Where(): CamlBuilder.IFieldExpression;
|
||||
/** Generate <View> tag for SP.CamlQuery
|
||||
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client. */
|
||||
View(viewFields?: string[]): CamlBuilder.IView;
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client.
|
||||
Additionally you can specify aggregated fields, e.g. { count: "<field name>" }, { sum: "<field name>" }, etc.. */
|
||||
View(viewFields?: CamlBuilder.ViewField[]): CamlBuilder.IView;
|
||||
/** Generate <ViewFields> tag for SPServices */
|
||||
ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
|
||||
/** Use for:
|
||||
1. SPServices CAMLQuery attribute
|
||||
2. Creating partial expressions
|
||||
3. In conjunction with Any & All clauses
|
||||
*/
|
||||
*/
|
||||
static Expression(): CamlBuilder.IFieldExpression;
|
||||
static FromXml(xml: string): CamlBuilder.IRawQuery;
|
||||
}
|
||||
declare namespace CamlBuilder {
|
||||
interface IView extends IJoinable, IFinalizable {
|
||||
declare module CamlBuilder {
|
||||
type Aggregation = {
|
||||
count: string;
|
||||
} | {
|
||||
sum: string;
|
||||
} | {
|
||||
avg: string;
|
||||
} | {
|
||||
max: string;
|
||||
} | {
|
||||
min: string;
|
||||
} | {
|
||||
stdev: string;
|
||||
} | {
|
||||
var: string;
|
||||
};
|
||||
type ViewField = string | Aggregation;
|
||||
interface IView extends IFinalizable {
|
||||
/** Define query */
|
||||
Query(): IQuery;
|
||||
/** Define maximum amount of returned records */
|
||||
RowLimit(limit: number, paged?: boolean): IView;
|
||||
/** Define view scope */
|
||||
Scope(scope: ViewScope): IView;
|
||||
}
|
||||
interface IJoinable {
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@@ -40,22 +58,39 @@ declare namespace CamlBuilder {
|
||||
@alias alias for the joined list */
|
||||
LeftJoin(lookupFieldInternalName: string, alias: string): IJoin;
|
||||
}
|
||||
interface IJoinable {
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@param alias Alias for the joined list
|
||||
@param fromList (optional) List where the lookup column resides - use it only for nested joins */
|
||||
InnerJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin;
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@param alias Alias for the joined list
|
||||
@param fromList (optional) List where the lookup column resides - use it only for nested joins */
|
||||
LeftJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin;
|
||||
}
|
||||
interface IJoin extends IJoinable {
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
interface IProjectableView extends IView {
|
||||
interface IProjectableView extends IJoinable {
|
||||
/** Define query */
|
||||
Query(): IQuery;
|
||||
/** Define maximum amount of returned records */
|
||||
RowLimit(limit: number, paged?: boolean): IView;
|
||||
/** Define view scope */
|
||||
Scope(scope: ViewScope): IView;
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
enum ViewScope {
|
||||
/** */
|
||||
Recursive = 0,
|
||||
/** */
|
||||
RecursiveAll = 1,
|
||||
/** */
|
||||
FilesOnly = 2,
|
||||
}
|
||||
interface IQuery extends IGroupable {
|
||||
@@ -85,8 +120,9 @@ declare namespace CamlBuilder {
|
||||
}
|
||||
interface IGroupable extends ISortable {
|
||||
/** Adds GroupBy clause to the query.
|
||||
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
|
||||
GroupBy(fieldInternalName: any): IGroupedQuery;
|
||||
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved.
|
||||
@param groupLimit Return only first N groups */
|
||||
GroupBy(fieldInternalName: any, collapse?: boolean, groupLimit?: number): IGroupedQuery;
|
||||
}
|
||||
interface IExpression extends IGroupable {
|
||||
/** Adds And clause to the query. */
|
||||
@@ -113,6 +149,12 @@ declare namespace CamlBuilder {
|
||||
Any(conditions: IExpression[]): IExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */
|
||||
TextField(internalName: string): ITextFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ContentTypeId */
|
||||
ContentTypeIdField(internalName?: string): ITextFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Choice */
|
||||
ChoiceField(internalName: string): ITextFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Computed */
|
||||
ComputedField(internalName: string): ITextFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */
|
||||
BooleanField(internalName: string): IBooleanFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is URL */
|
||||
@@ -360,7 +402,7 @@ declare namespace CamlBuilder {
|
||||
Year = 4,
|
||||
}
|
||||
class Internal {
|
||||
static createView(viewFields?: string[]): IView;
|
||||
static createView(viewFields?: ViewField[]): IView;
|
||||
static createViewFields(viewFields: string[]): IFinalizableToString;
|
||||
static createWhere(): IFieldExpression;
|
||||
static createExpression(): IFieldExpression;
|
||||
@@ -401,3 +443,4 @@ declare namespace CamlBuilder {
|
||||
};
|
||||
}
|
||||
}
|
||||
export = CamlBuilder;
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
|
||||
@@ -18,6 +18,9 @@ const Memory: EnginePrototypeOrObject = {
|
||||
|
||||
const client = new Client<string>(Memory, { partition: 'cache' });
|
||||
|
||||
client.start().then(() => {});
|
||||
client.stop().then(() => {});
|
||||
|
||||
const cache = new Policy({
|
||||
expiresIn: 5000,
|
||||
}, client, 'cache');
|
||||
|
||||
2
types/catbox/index.d.ts
vendored
2
types/catbox/index.d.ts
vendored
@@ -23,7 +23,7 @@ export class Client<T> implements ClientApi<T> {
|
||||
/** start() - creates a connection to the cache server. Must be called before any other method is available. */
|
||||
start(): Promise<void>;
|
||||
/** stop() - terminates the connection to the cache server. */
|
||||
stop(): void;
|
||||
stop(): Promise<void>;
|
||||
/**
|
||||
* get(key, callback) - retrieve an item from the cache engine if found where:
|
||||
* * key - a cache key object (see [ICacheKey]).
|
||||
|
||||
2
types/chrome/index.d.ts
vendored
2
types/chrome/index.d.ts
vendored
@@ -5246,7 +5246,7 @@ declare namespace chrome.runtime {
|
||||
|
||||
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { }
|
||||
|
||||
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { }
|
||||
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void> { }
|
||||
|
||||
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
|
||||
|
||||
|
||||
2
types/cordova-sqlite-storage/index.d.ts
vendored
2
types/cordova-sqlite-storage/index.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
// Type definitions for cordova-sqlite-storage 1.5
|
||||
// Project: https://github.com/litehelpers/Cordova-sqlite-storage
|
||||
// Project: https://github.com/xpbrew/cordova-sqlite-storage
|
||||
// Definitions by: rafw87 <https://github.com/rafw87>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
23
types/cytoscape/index.d.ts
vendored
23
types/cytoscape/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Cytoscape.js 3.2
|
||||
// Type definitions for Cytoscape.js 3.3
|
||||
// Project: http://js.cytoscape.org/
|
||||
// Definitions by: Fabian Schmidt and Fred Eisele <https://github.com/phreed>
|
||||
// Shenghan Gao <https://github.com/wy193777>
|
||||
@@ -464,6 +464,27 @@ declare namespace cytoscape {
|
||||
*/
|
||||
endBatch(): void;
|
||||
|
||||
/**
|
||||
* Attaches the instance to the specified container for visualisation.
|
||||
* http://js.cytoscape.org/#cy.mount
|
||||
*
|
||||
* If the core instance is headless prior to calling cy.mount(), then
|
||||
* the instance will no longer be headless and the visualisation will
|
||||
* be shown in the specified container. If the core instance is
|
||||
* non-headless prior to calling cy.mount(), then the visualisation
|
||||
* is swapped from the prior container to the specified container.
|
||||
*/
|
||||
mount(element: Element): void;
|
||||
|
||||
/**
|
||||
* Remove the instance from its current container.
|
||||
* http://js.cytoscape.org/#cy.unmount
|
||||
*
|
||||
* This function sets the instance to be headless after unmounting from
|
||||
* the current container.
|
||||
*/
|
||||
unmount(): void;
|
||||
|
||||
/**
|
||||
* A convenience function to explicitly destroy the Core.
|
||||
* http://js.cytoscape.org/#cy.destroy
|
||||
|
||||
@@ -608,7 +608,8 @@ const testObject = {
|
||||
};
|
||||
|
||||
const p1: Array<number | string | Date | number[]> = d3Array.permute(testObject, ['name', 'val', 'when', 'more']);
|
||||
const p2: Array<Date | number[]> = d3Array.permute(testObject, ['when', 'more']);
|
||||
// $ExpectType: Array<Date | number[]>
|
||||
const p2 = d3Array.permute(testObject, ['when', 'more']);
|
||||
// $ExpectError
|
||||
const p3 = d3Array.permute(testObject, ['when', 'unknown']);
|
||||
|
||||
|
||||
2
types/debug/index.d.ts
vendored
2
types/debug/index.d.ts
vendored
@@ -38,7 +38,7 @@ declare namespace debug {
|
||||
(formatter: any, ...args: any[]): void;
|
||||
|
||||
enabled: boolean;
|
||||
log: (v: any) => string;
|
||||
log: (...args: any[]) => any;
|
||||
namespace: string;
|
||||
extend: (namespace: string, delimiter?: string) => Debugger;
|
||||
}
|
||||
|
||||
4
types/ej.web.all/index.d.ts
vendored
4
types/ej.web.all/index.d.ts
vendored
@@ -8,8 +8,8 @@
|
||||
|
||||
/*!
|
||||
* filename: ej.web.all.d.ts
|
||||
* version : 16.4.0.42
|
||||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.
|
||||
* version : 16.4.0.52
|
||||
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.
|
||||
* Use of this code is subject to the terms of our license.
|
||||
* A copy of the current license can be obtained at any time by e-mailing
|
||||
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
||||
|
||||
2
types/elliptic/index.d.ts
vendored
2
types/elliptic/index.d.ts
vendored
@@ -187,7 +187,7 @@ export class ec {
|
||||
|
||||
export namespace ec {
|
||||
interface GenKeyPairOptions {
|
||||
pers: any;
|
||||
pers?: any;
|
||||
entropy: any;
|
||||
persEnc?: string;
|
||||
entropyEnc?: string;
|
||||
|
||||
22
types/express-urlrewrite/express-urlrewrite-tests.ts
Normal file
22
types/express-urlrewrite/express-urlrewrite-tests.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as express from "express";
|
||||
|
||||
import rewrite = require("express-urlrewrite");
|
||||
|
||||
declare const app: express.Application;
|
||||
|
||||
app.use(rewrite(/^\/i(\w+)/, "/items/$1"));
|
||||
|
||||
app.use(rewrite("/:src..:dst", "/commits/$1/to/$2"));
|
||||
app.use(rewrite("/:src..:dst", "/commits/:src/to/:dst"));
|
||||
|
||||
app.use(rewrite("/js/*", "/public/assets/js/$1"));
|
||||
|
||||
app.use(rewrite("/file\\?param=:param", "/file/:param"));
|
||||
|
||||
app.use(rewrite("/path", "/anotherpath?param=some"));
|
||||
|
||||
app.get("/route/:var", rewrite("/rewritten/:var"));
|
||||
|
||||
declare const someMw: express.Handler;
|
||||
|
||||
app.get("/rewritten/:var", someMw);
|
||||
12
types/express-urlrewrite/index.d.ts
vendored
Normal file
12
types/express-urlrewrite/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for express-urlrewrite 1.2
|
||||
// Project: https://github.com/kapouer/express-urlrewrite
|
||||
// Definitions by: Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import * as express from "express";
|
||||
|
||||
declare function rewrite(s: string): express.Handler;
|
||||
declare function rewrite(s: string | RegExp, t: string): express.Handler;
|
||||
|
||||
export = rewrite;
|
||||
@@ -6,23 +6,18 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"i18next-browser-languagedetector": [
|
||||
"i18next-browser-languagedetector/v0"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"i18next-browser-languagedetector-tests.ts"
|
||||
"express-urlrewrite-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
12
types/favicons/index.d.ts
vendored
12
types/favicons/index.d.ts
vendored
@@ -9,7 +9,7 @@
|
||||
import { Duplex } from "stream";
|
||||
|
||||
declare namespace favicons {
|
||||
interface Configuration {
|
||||
interface Configuration {
|
||||
/** Path for overriding default icons path @default "/" */
|
||||
path: string;
|
||||
/** Your application's name @default null */
|
||||
@@ -38,6 +38,8 @@ declare namespace favicons {
|
||||
version: string;
|
||||
/** Print logs to console? @default false */
|
||||
logging: boolean;
|
||||
/** Use nearest neighbor resampling to preserve hard edges on pixel art @default false */
|
||||
pixel_art: boolean;
|
||||
/**
|
||||
* Platform Options:
|
||||
* - offset - offset in percentage
|
||||
@@ -66,18 +68,18 @@ declare namespace favicons {
|
||||
}>;
|
||||
}
|
||||
|
||||
interface FavIconResponse {
|
||||
interface FavIconResponse {
|
||||
images: Array<{ name: string; contents: Buffer }>;
|
||||
files: Array<{ name: string; contents: Buffer }>;
|
||||
html: string[];
|
||||
}
|
||||
|
||||
type Callback = (error: Error | null, response: FavIconResponse) => void;
|
||||
type Callback = (error: Error | null, response: FavIconResponse) => void;
|
||||
|
||||
/** You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with this export */
|
||||
const config: Configuration;
|
||||
const config: Configuration;
|
||||
|
||||
function stream(configuration?: Configuration): Duplex;
|
||||
function stream(configuration?: Configuration): Duplex;
|
||||
}
|
||||
/**
|
||||
* Generate favicons
|
||||
|
||||
2
types/firefox-webext-browser/index.d.ts
vendored
2
types/firefox-webext-browser/index.d.ts
vendored
@@ -3188,7 +3188,7 @@ declare namespace browser.storage {
|
||||
* @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item.
|
||||
* @param areaName The name of the storage area (`"sync"`, `"local"` or `"managed"`) the changes are for.
|
||||
*/
|
||||
const onChanged: WebExtEvent<(changes: StorageChange, areaName: string) => void>;
|
||||
const onChanged: WebExtEvent<(changes: {[key: string]: StorageChange}, areaName: string) => void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import * as i18next from "i18next";
|
||||
import * as LngDetector from "i18next-browser-languagedetector";
|
||||
|
||||
const options: LngDetector.DetectorOptions = {
|
||||
// order and from where user language should be detected
|
||||
order: ["querystring", "cookie", "localStorage", "navigator", "htmlTag"],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: "lng",
|
||||
lookupCookie: "i18next",
|
||||
lookupLocalStorage: "i18nextLng",
|
||||
|
||||
// cache user language on
|
||||
caches: ["localStorage", "cookie"],
|
||||
excludeCacheFor: ["cimode"], // languages to not persist (cookie, localStorage)
|
||||
|
||||
// optional expire and domain for set cookie
|
||||
cookieMinutes: 10,
|
||||
cookieDomain: "myDomain",
|
||||
|
||||
// optional htmlTag with lang attribute, the default is:
|
||||
htmlTag: document.documentElement
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
const customDetector: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
return "en";
|
||||
},
|
||||
|
||||
cacheUserLanguage(lng: string, options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
// lng -> current language, will be called after init and on changeLanguage
|
||||
|
||||
// store it
|
||||
}
|
||||
};
|
||||
|
||||
const customDetector2: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const lngDetector = new LngDetector(null, options);
|
||||
|
||||
lngDetector.init(options);
|
||||
lngDetector.addDetector(customDetector);
|
||||
|
||||
i18next
|
||||
.use(lngDetector)
|
||||
.init({
|
||||
detection: options
|
||||
});
|
||||
@@ -1,65 +0,0 @@
|
||||
// Type definitions for i18next-browser-languagedetector 2.0
|
||||
// Project: http://i18next.com/, https://github.com/i18next/i18next-browser-languagedetector
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare namespace i18nextBrowserLanguageDetector {
|
||||
interface DetectorOptions {
|
||||
/**
|
||||
* order and from where user language should be detected
|
||||
*/
|
||||
order?: Array<"querystring" | "cookie" | "localStorage" | "navigator" | "htmlTag" | string>;
|
||||
|
||||
/**
|
||||
* keys or params to lookup language from
|
||||
*/
|
||||
lookupQuerystring?: string;
|
||||
lookupCookie?: string;
|
||||
lookupLocalStorage?: string;
|
||||
|
||||
/**
|
||||
* cache user language on
|
||||
*/
|
||||
caches?: string[];
|
||||
|
||||
/**
|
||||
* languages to not persist (cookie, localStorage)
|
||||
*/
|
||||
excludeCacheFor?: string[];
|
||||
|
||||
/**
|
||||
* optional expire and domain for set cookie
|
||||
* @default 10
|
||||
*/
|
||||
cookieMinutes?: number;
|
||||
cookieDomain?: string;
|
||||
|
||||
/**
|
||||
* optional htmlTag with lang attribute
|
||||
* @default document.documentElement
|
||||
*/
|
||||
htmlTag?: HTMLElement;
|
||||
}
|
||||
|
||||
interface CustomDetector {
|
||||
name: string;
|
||||
cacheUserLanguage?(lng: string, options: DetectorOptions): void;
|
||||
lookup(options: DetectorOptions): string | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
declare class i18nextBrowserLanguageDetector {
|
||||
constructor(services?: any, options?: i18nextBrowserLanguageDetector.DetectorOptions);
|
||||
/**
|
||||
* Adds detector.
|
||||
*/
|
||||
addDetector(detector: i18nextBrowserLanguageDetector.CustomDetector): i18nextBrowserLanguageDetector;
|
||||
|
||||
/**
|
||||
* Initializes detector.
|
||||
*/
|
||||
init(options?: i18nextBrowserLanguageDetector.DetectorOptions): void;
|
||||
}
|
||||
|
||||
export = i18nextBrowserLanguageDetector;
|
||||
@@ -1,42 +0,0 @@
|
||||
import * as i18next from 'i18next';
|
||||
import LngDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
const options = {
|
||||
// order and from where user language should be detected
|
||||
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
|
||||
// cache user language on
|
||||
caches: ['localStorage', 'cookie'],
|
||||
|
||||
// optional expire and domain for set cookie
|
||||
cookieMinutes: 10,
|
||||
cookieDomain: 'myDomain'
|
||||
};
|
||||
const myDetector = {
|
||||
name: 'myDetectorsName',
|
||||
|
||||
lookup(options: {}) {
|
||||
// options -> are passed in options
|
||||
return 'en';
|
||||
},
|
||||
|
||||
cacheUserLanguage(lng: string, options: {}) {
|
||||
// options -> are passed in options
|
||||
// lng -> current language, will be called after init and on changeLanguage
|
||||
|
||||
// store it
|
||||
}
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
const lngDetector = new LngDetector(null, options);
|
||||
lngDetector.init(options);
|
||||
lngDetector.addDetector(myDetector);
|
||||
@@ -1,58 +0,0 @@
|
||||
// Type definitions for i18next-browser-languagedetector 0.0
|
||||
// Project: http://i18next.com/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as i18next from "i18next";
|
||||
|
||||
declare namespace I18next {
|
||||
interface I18nextStatic extends i18nextBrowserLanguageDetector.I18nextStatic { }
|
||||
interface I18nextOptions extends i18nextBrowserLanguageDetector.I18nextOptions { }
|
||||
}
|
||||
|
||||
declare namespace i18nextBrowserLanguageDetector {
|
||||
/** Interface for Language detector options. */
|
||||
interface LanguageDetectorOptions {
|
||||
caches?: string[] | boolean;
|
||||
cookieDomain?: string;
|
||||
cookieExpirationDate?: Date;
|
||||
lookupCookie?: string;
|
||||
lookupFromPathIndex?: number;
|
||||
lookupQuerystring?: string;
|
||||
lookupSession?: string;
|
||||
order?: string[];
|
||||
}
|
||||
|
||||
/** Interface for custom detector. */
|
||||
interface CustomDetector {
|
||||
name: string;
|
||||
|
||||
// todo: Checks parameters type.
|
||||
cacheUserLanguage(lng: string, options: {}): void;
|
||||
lookup(options: {}): string;
|
||||
}
|
||||
|
||||
/** i18next options. */
|
||||
interface I18nextOptions {
|
||||
detection?: LanguageDetectorOptions;
|
||||
}
|
||||
|
||||
/** i18next interface. */
|
||||
interface I18nextStatic {
|
||||
use(module: LngDetector): I18nextStatic;
|
||||
}
|
||||
|
||||
/** i18next language detection. */
|
||||
class LngDetector {
|
||||
constructor(services?: any, options?: LanguageDetectorOptions);
|
||||
|
||||
/** Adds detector. */
|
||||
addDetector(detector: CustomDetector): LngDetector;
|
||||
|
||||
/** Initializes detector. */
|
||||
init(options?: LanguageDetectorOptions): void;
|
||||
}
|
||||
}
|
||||
|
||||
export default i18nextBrowserLanguageDetector.LngDetector;
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [
|
||||
false
|
||||
],
|
||||
"no-empty-interface": [
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
9
types/indefinite/indefinite-tests.ts
Normal file
9
types/indefinite/indefinite-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { indefinite } from "indefinite";
|
||||
|
||||
const anApple = indefinite("apple"); // "an apple"
|
||||
const aBanana = indefinite('banana'); // "a banana"
|
||||
const AnApple = indefinite('apple', { capitalize: true }); // "An apple"
|
||||
const anEight = indefinite("8"); // "an 8"
|
||||
const anEightAsNumber = indefinite(8); // "an 8"
|
||||
const a1892 = indefinite("1892"); // "a 1892" -> read "a one thousand eight hundred ninety-two"
|
||||
const a1892AsColloquial = indefinite("1892", { numbers: "colloquial" }); // "an 1892" -> read "an eighteen ninety-two"
|
||||
11
types/indefinite/index.d.ts
vendored
Normal file
11
types/indefinite/index.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// Type definitions for indefinite 2.2
|
||||
// Project: https://github.com/tandrewnichols/indefinite
|
||||
// Definitions by: omaishar <https://github.com/omaishr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Options {
|
||||
capitalize?: boolean;
|
||||
caseInsensitive?: boolean;
|
||||
numbers?: "colloquial";
|
||||
}
|
||||
export function indefinite(word: string | number, opts?: Options): string;
|
||||
23
types/indefinite/tsconfig.json
Normal file
23
types/indefinite/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"indefinite-tests.ts"
|
||||
]
|
||||
}
|
||||
39
types/ink-spinner/index.d.ts
vendored
Normal file
39
types/ink-spinner/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Type definitions for ink-spinner 2.0
|
||||
// Project: https://github.com/vadimdemedes/ink-spinner#readme
|
||||
// Definitions by: Łukasz Ostrowski <https://github.com/lukostry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Chalk } from 'chalk';
|
||||
import * as cliSpinners from 'cli-spinners';
|
||||
import { Component } from 'ink';
|
||||
|
||||
type StringifyPartial<T> = {
|
||||
[P in keyof T]?: string;
|
||||
};
|
||||
|
||||
type BooleansPartial<T> = {
|
||||
[P in keyof T]?: boolean;
|
||||
};
|
||||
|
||||
type TupleOfNumbersPartial<T> = {
|
||||
[P in keyof T]?: [number, number, number];
|
||||
};
|
||||
// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
|
||||
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
type ChalkColorModels = Pick<Chalk, 'rgb' | 'hsl' | 'hsv' | 'hwb' | 'bgRgb' | 'bgHsl' | 'bgHsv' | 'bgHwb'>;
|
||||
type ChalkKeywordsAndHexes = Pick<Chalk, 'keyword' | 'hex' | 'bgKeyword' | 'bgHex'>;
|
||||
type ChalkCommons = Omit<Chalk, keyof ChalkColorModels | keyof ChalkKeywordsAndHexes | 'constructor' | 'level' | 'enabled'>;
|
||||
|
||||
interface SpinnerProps {
|
||||
type?: cliSpinners.SpinnerName;
|
||||
}
|
||||
|
||||
type ChalkProps = BooleansPartial<ChalkCommons>
|
||||
& StringifyPartial<ChalkKeywordsAndHexes>
|
||||
& TupleOfNumbersPartial<ChalkColorModels>;
|
||||
|
||||
declare class Spinner extends Component<SpinnerProps & ChalkProps> { }
|
||||
|
||||
export = Spinner;
|
||||
10
types/ink-spinner/ink-spinner-tests.tsx
Normal file
10
types/ink-spinner/ink-spinner-tests.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
/** @jsx h */
|
||||
import { h } from 'ink';
|
||||
import Spinner from 'ink-spinner';
|
||||
// NOTE: `import Spinner = require('ink-spinner');` will work as well.
|
||||
// If importing using ES6 default import as above,
|
||||
// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true`
|
||||
|
||||
const Demo = () => {
|
||||
return <Spinner type="line" rgb={[255, 255, 255]} />;
|
||||
};
|
||||
25
types/ink-spinner/tsconfig.json
Normal file
25
types/ink-spinner/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"jsx": "react",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ink-spinner-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/ink-spinner/tslint.json
Normal file
1
types/ink-spinner/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
5
types/iobroker/index.d.ts
vendored
5
types/iobroker/index.d.ts
vendored
@@ -900,7 +900,7 @@ declare global {
|
||||
q?: boolean;
|
||||
addID?: boolean;
|
||||
limit?: number;
|
||||
ignoreNull: boolean;
|
||||
ignoreNull?: boolean;
|
||||
sessionId?: any;
|
||||
aggregate?: "minmax" | "min" | "max" | "average" | "total" | "count" | "none";
|
||||
}
|
||||
@@ -1682,7 +1682,8 @@ declare global {
|
||||
type SetStateCallback = (err: string | null, id?: string) => void;
|
||||
type SetStateChangedCallback = (err: string | null, id: string, notChanged: boolean) => void;
|
||||
type DeleteStateCallback = (err: string | null, id?: string) => void;
|
||||
type GetHistoryCallback = (err: string | null, result: Array<(State & { id?: string })>, step: number, sessionId?: string) => void;
|
||||
type GetHistoryResult = Array<(State & { id?: string })>;
|
||||
type GetHistoryCallback = (err: string | null, result: GetHistoryResult, step: number, sessionId?: string) => void;
|
||||
|
||||
/** Contains the return values of readDir */
|
||||
interface ReadDirResult {
|
||||
|
||||
@@ -270,6 +270,8 @@ adapter.subscribeForeignStatesAsync("*").catch(handleError);
|
||||
adapter.unsubscribeStatesAsync("*").catch(handleError);
|
||||
adapter.unsubscribeForeignStatesAsync("*").catch(handleError);
|
||||
|
||||
adapter.getHistory("state.id", {}, (err, result: ioBroker.GetHistoryResult) => {});
|
||||
|
||||
// Repro from https://github.com/ioBroker/adapter-core/issues/3
|
||||
const repro1: ioBroker.ObjectChangeHandler = (id, obj) => {
|
||||
if (!obj || !obj.common) return;
|
||||
|
||||
18
types/ioredis/index.d.ts
vendored
18
types/ioredis/index.d.ts
vendored
@@ -272,7 +272,7 @@ declare namespace IORedis {
|
||||
hgetBuffer(key: KeyType, field: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
hgetBuffer(key: KeyType, field: string): Promise<Buffer>;
|
||||
|
||||
hmset(key: KeyType, field: string, value: any, ...args: string[]): Promise<0 | 1>;
|
||||
hmset(key: KeyType, ...args: any[]): Promise<0 | 1>;
|
||||
hmset(key: KeyType, data: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hmset(key: KeyType, data: any): Promise<0 | 1>;
|
||||
|
||||
@@ -313,9 +313,13 @@ declare namespace IORedis {
|
||||
getset(key: KeyType, value: any, callback: (err: Error, res: string | null) => void): void;
|
||||
getset(key: KeyType, value: any): Promise<string | null>;
|
||||
|
||||
mset(key: KeyType, value: any, ...args: string[]): any;
|
||||
mset(...args: any[]): any;
|
||||
mset(data: any, callback: (err: Error, res: string) => void): void;
|
||||
mset(data: any): Promise<string>;
|
||||
|
||||
msetnx(key: KeyType, value: any, ...args: string[]): any;
|
||||
msetnx(...args: any[]): any;
|
||||
msetnx(data: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
msetnx(data: any): Promise<0 | 1>;
|
||||
|
||||
randomkey(callback: (err: Error, res: string) => void): void;
|
||||
randomkey(): Promise<string>;
|
||||
@@ -675,7 +679,7 @@ declare namespace IORedis {
|
||||
hget(key: KeyType, field: string, callback?: (err: Error, res: string | string) => void): Pipeline;
|
||||
hgetBuffer(key: KeyType, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
hmset(key: KeyType, field: string, value: any, ...args: string[]): Pipeline;
|
||||
hmset(key: KeyType, ...args: any[]): Pipeline;
|
||||
hmset(key: KeyType, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
hmget(key: KeyType, ...fields: string[]): Pipeline;
|
||||
@@ -704,9 +708,11 @@ declare namespace IORedis {
|
||||
|
||||
getset(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
mset(key: KeyType, value: any, ...args: string[]): Pipeline;
|
||||
mset(...args: any[]): Pipeline;
|
||||
mset(data: any, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
msetnx(key: KeyType, value: any, ...args: string[]): Pipeline;
|
||||
msetnx(...args: any[]): Pipeline;
|
||||
msetnx(data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
randomkey(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
|
||||
@@ -154,6 +154,9 @@ redis.multi([
|
||||
const keys = ['foo', 'bar'];
|
||||
redis.mget(...keys);
|
||||
|
||||
redis.mset(...['foo', 'bar']);
|
||||
redis.mset({ foo: 'bar' });
|
||||
|
||||
new Redis.Cluster([
|
||||
'localhost'
|
||||
]);
|
||||
|
||||
2
types/jenkins/index.d.ts
vendored
2
types/jenkins/index.d.ts
vendored
@@ -15,7 +15,7 @@ declare namespace create {
|
||||
log(name: string, n: number, start: number, callback: (err: Error, data: any) => void): void;
|
||||
log(name: string, n: number, start: number, type: 'text' | 'html', callback: (err: Error, data: any) => void): void;
|
||||
log(name: string, n: number, start: number, type: 'text' | 'html', meta: boolean, callback: (err: Error, data: any) => void): void;
|
||||
logStream(name: string, n: number, type?: 'text' | 'html', delay?: number): NodeJS.ReadableStream;
|
||||
logStream(name: string, n: number, options?: { type?: 'text' | 'html', delay?: number }): NodeJS.ReadableStream;
|
||||
stop(name: string, n: number, callback: (err: Error) => void): void;
|
||||
term(name: string, n: number, callback: (err: Error) => void): void;
|
||||
};
|
||||
|
||||
@@ -34,6 +34,20 @@ log.on('end', () => {
|
||||
console.log('end');
|
||||
});
|
||||
|
||||
const log2 = jenkins.build.logStream('example', 1, { type: 'html', delay: 2 * 1000 });
|
||||
|
||||
log2.on('data', (text: string) => {
|
||||
process.stdout.write(text);
|
||||
});
|
||||
|
||||
log2.on('error', (err: Error) => {
|
||||
console.log('error', err);
|
||||
});
|
||||
|
||||
log2.on('end', () => {
|
||||
console.log('end');
|
||||
});
|
||||
|
||||
jenkins.build.stop('example', 1, (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
3
types/joi/index.d.ts
vendored
3
types/joi/index.d.ts
vendored
@@ -15,6 +15,7 @@
|
||||
// Peter Thorson <https://github.com/zaphoyd>
|
||||
// Will Garcia <https://github.com/thewillg>
|
||||
// Simon Schick <https://github.com/SimonSchick>
|
||||
// Alejandro Fernandez Haro <https://github.com/afharo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -704,7 +705,7 @@ export interface ArraySchema extends AnySchema {
|
||||
* `schema` - the validation rules required to satisfy the assertion. If the `schema` includes references, they are resolved against
|
||||
* the array item being tested, not the value of the `ref` target.
|
||||
*/
|
||||
assertItem(schema: SchemaLike): this;
|
||||
has(schema: SchemaLike): this;
|
||||
/**
|
||||
* Allow this array to be sparse.
|
||||
* enabled can be used with a falsy value to go back to the default behavior.
|
||||
|
||||
@@ -312,7 +312,7 @@ anySchema = Joi.any();
|
||||
|
||||
arrSchema = Joi.array();
|
||||
|
||||
arrSchema = arrSchema.assertItem(Joi.any());
|
||||
arrSchema = arrSchema.has(Joi.any());
|
||||
arrSchema = arrSchema.sparse();
|
||||
arrSchema = arrSchema.sparse(bool);
|
||||
arrSchema = arrSchema.single();
|
||||
|
||||
4
types/klaw/index.d.ts
vendored
4
types/klaw/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for klaw v2.1.1
|
||||
// Type definitions for klaw v3.0.0
|
||||
// Project: https://github.com/jprichardson/node-klaw
|
||||
// Definitions by: Matthew McEachen <https://github.com/mceachen>
|
||||
// Pascal Sthamer <https://github.com/p4sca1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -26,6 +27,7 @@ declare module "klaw" {
|
||||
fs?: any // fs or mock-fs
|
||||
filter?: (path: string) => boolean
|
||||
depthLimit?: number
|
||||
preserveSymlinks?: boolean
|
||||
}
|
||||
|
||||
type Event = "close" | "data" | "end" | "readable" | "error"
|
||||
|
||||
@@ -5,7 +5,7 @@ const path = require('path');
|
||||
|
||||
let items: klaw.Item[] = [] // files, directories, symlinks, etc
|
||||
|
||||
klaw('/some/dir')
|
||||
klaw('/some/dir', { preserveSymlinks: false })
|
||||
.on('data', function(item: klaw.Item) {
|
||||
items.push(item)
|
||||
})
|
||||
|
||||
10
types/leaflet/index.d.ts
vendored
10
types/leaflet/index.d.ts
vendored
@@ -626,7 +626,7 @@ export interface PathOptions extends InteractiveLayerOptions {
|
||||
opacity?: number;
|
||||
lineCap?: LineCapShape;
|
||||
lineJoin?: LineJoinShape;
|
||||
dashArray?: string;
|
||||
dashArray?: string | number[];
|
||||
dashOffset?: string;
|
||||
fill?: boolean;
|
||||
fillColor?: string;
|
||||
@@ -1134,14 +1134,15 @@ export interface PopupOptions extends DivOverlayOptions {
|
||||
maxWidth?: number;
|
||||
minWidth?: number;
|
||||
maxHeight?: number;
|
||||
keepInView?: boolean;
|
||||
closeButton?: boolean;
|
||||
autoPan?: boolean;
|
||||
autoPanPaddingTopLeft?: PointExpression;
|
||||
autoPanPaddingBottomRight?: PointExpression;
|
||||
autoPanPadding?: PointExpression;
|
||||
keepInView?: boolean;
|
||||
closeButton?: boolean;
|
||||
autoClose?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
closeOnEscapeKey?: boolean;
|
||||
}
|
||||
|
||||
export type Content = string | HTMLElement;
|
||||
@@ -1534,6 +1535,9 @@ export interface MarkerOptions extends InteractiveLayerOptions {
|
||||
opacity?: number;
|
||||
riseOnHover?: boolean;
|
||||
riseOffset?: number;
|
||||
autoPan?: boolean;
|
||||
autoPanSpeed?: number;
|
||||
autoPanPadding?: PointExpression;
|
||||
}
|
||||
|
||||
export class Marker<P = any> extends Layer {
|
||||
|
||||
@@ -506,7 +506,10 @@ export class MyNewControl extends L.Control {
|
||||
L.marker([1, 2], {
|
||||
icon: L.icon({
|
||||
iconUrl: 'my-icon.png'
|
||||
})
|
||||
}),
|
||||
autoPan: true,
|
||||
autoPanPadding: [10, 20],
|
||||
autoPanSpeed: 5,
|
||||
}).bindPopup('<p>Hi</p>');
|
||||
|
||||
L.marker([1, 2], {
|
||||
|
||||
2
types/luxon/index.d.ts
vendored
2
types/luxon/index.d.ts
vendored
@@ -426,7 +426,7 @@ export class Interval {
|
||||
engulfs(other: Interval): boolean;
|
||||
equals(other: Interval): boolean;
|
||||
hasSame(unit: DurationUnit): boolean;
|
||||
intersection(other: Interval): Interval;
|
||||
intersection(other: Interval): Interval | null;
|
||||
isAfter(dateTime: DateTime): boolean;
|
||||
isBefore(dateTime: DateTime): boolean;
|
||||
isEmpty(): boolean;
|
||||
|
||||
@@ -140,6 +140,7 @@ i.length('years'); // $ExpectType number
|
||||
i.contains(DateTime.local(2019)); // $ExpectType boolean
|
||||
i.set({end: DateTime.local(2020)}); // $ExpectType Interval
|
||||
i.mapEndpoints((d) => d); // $ExpectType Interval
|
||||
i.intersection(i); // $ExpectType Interval | null
|
||||
|
||||
i.toISO(); // $ExpectType string
|
||||
i.toString(); // $ExpectType string
|
||||
|
||||
2
types/mongoose/index.d.ts
vendored
2
types/mongoose/index.d.ts
vendored
@@ -337,7 +337,7 @@ declare module "mongoose" {
|
||||
/** Use ssl connection (needs to have a mongod server with ssl support) (default: true) */
|
||||
ssl?: boolean;
|
||||
/** Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) */
|
||||
sslValidate?: object;
|
||||
sslValidate?: boolean;
|
||||
/** Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. */
|
||||
poolSize?: number;
|
||||
/** Reconnect on error (default: true) */
|
||||
|
||||
7
types/moveto/index.d.ts
vendored
7
types/moveto/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for moveto 1.7
|
||||
// Type definitions for moveto 1.8
|
||||
// Project: https://github.com/hsnaydd/moveTo
|
||||
// Definitions by: Rostislav Shermenyov <https://github.com/shermendev>
|
||||
// pea3nut <https://github.com/pea3nut>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class MoveTo {
|
||||
@@ -66,6 +67,10 @@ declare namespace MoveTo {
|
||||
* Ease function name
|
||||
*/
|
||||
easing?: string;
|
||||
/**
|
||||
* The container been computed and scrolled
|
||||
*/
|
||||
container?: Window | HTMLElement;
|
||||
/**
|
||||
* The function to be run after scrolling complete. Target passes as the first argument
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ const options: MoveTo.MoveToOptions = {
|
||||
tolerance: 70,
|
||||
duration: 300,
|
||||
easing: "easeOutQuart",
|
||||
container: Math.random() > 0.5 ? window : document.createElement('div'),
|
||||
callback: () => {}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import randomBrowser = require('nanoid/random-browser');
|
||||
import url = require('nanoid/url');
|
||||
import nanoidAsync = require('nanoid/async');
|
||||
import nanoidAsyncBrowser = require('nanoid/async-browser');
|
||||
import nanoidNonSecure = require('nanoid/non-secure');
|
||||
import generateNonSecure = require('nanoid/non-secure/generate');
|
||||
|
||||
const _random = (size: number) => [1, 2, 3, 4];
|
||||
|
||||
@@ -22,5 +24,9 @@ nanoidAsync(null, (error, id) => {
|
||||
});
|
||||
nanoidAsyncBrowser().then((id) => console.log(id));
|
||||
nanoidAsyncBrowser(10).then((id) => console.log(id));
|
||||
nanoidNonSecure();
|
||||
nanoidNonSecure(10);
|
||||
generateNonSecure('0123456789абвгдеё', 5);
|
||||
generateNonSecure('0123456789абвгдеё');
|
||||
|
||||
console.log(url);
|
||||
|
||||
19
types/nanoid/non-secure/generate.d.ts
vendored
Normal file
19
types/nanoid/non-secure/generate.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generate URL-friendly unique ID. This method use non-secure predictable
|
||||
* random generator.
|
||||
*
|
||||
* By default, ID will have 21 symbols to have a collision probability similar
|
||||
* to UUID v4.
|
||||
*
|
||||
* @param alphabet Symbols to be used in ID.
|
||||
* @param [size=21] The number of symbols in ID.
|
||||
*
|
||||
* @return Random string.
|
||||
*
|
||||
* @example
|
||||
* const nanoid = require('nanoid/non-secure')
|
||||
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
||||
*/
|
||||
declare function generate(alphabet: string, size?: number): string;
|
||||
|
||||
export = generate;
|
||||
18
types/nanoid/non-secure/index.d.ts
vendored
Normal file
18
types/nanoid/non-secure/index.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generate URL-friendly unique ID. This method use non-secure predictable
|
||||
* random generator.
|
||||
*
|
||||
* By default, ID will have 21 symbols to have a collision probability similar
|
||||
* to UUID v4.
|
||||
*
|
||||
* @param [size=21] The number of symbols in ID.
|
||||
*
|
||||
* @return Random string.
|
||||
*
|
||||
* @example
|
||||
* const nanoid = require('nanoid/non-secure')
|
||||
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
||||
*/
|
||||
declare function nanoid(size?: number): string;
|
||||
|
||||
export = nanoid;
|
||||
@@ -17,6 +17,8 @@
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"non-secure/index.d.ts",
|
||||
"non-secure/generate.d.ts",
|
||||
"async-browser.d.ts",
|
||||
"async.d.ts",
|
||||
"format.d.ts",
|
||||
|
||||
8
types/next-server/dynamic.d.ts
vendored
8
types/next-server/dynamic.d.ts
vendored
@@ -7,9 +7,9 @@ import {
|
||||
|
||||
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
type AsyncComponent<P = any> = Promise<React.ComponentType<P>>;
|
||||
type AsyncComponent<P = any> = Promise<React.ComponentType<P> | { default: React.ComponentType<P> }>;
|
||||
type AsyncComponentLoader<P = any> = () => AsyncComponent<P>;
|
||||
type ModuleMapping = Record<string, AsyncComponent>;
|
||||
type ModuleMapping = Record<string, AsyncComponent | AsyncComponentLoader>;
|
||||
type LoadedModuleMapping = Record<string, React.ComponentType>;
|
||||
|
||||
interface NextDynamicOptions<P = {}> extends Omit<LoadableOptions, "loading" | "modules"> {
|
||||
@@ -31,10 +31,10 @@ type DynamicComponent<P> = React.ComponentType<P> & LoadableComponent;
|
||||
* https://github.com/zeit/next.js/blob/7.0.0/lib/dynamic.js#L55
|
||||
*/
|
||||
declare function dynamic<P = {}>(
|
||||
options: AsyncComponentLoader<P> | AsyncComponent<P> | NextDynamicOptions<P>
|
||||
asyncModuleOrOptions: AsyncComponentLoader<P> | AsyncComponent<P> | NextDynamicOptions<P>
|
||||
): DynamicComponent<P>;
|
||||
declare function dynamic<P = {}>(
|
||||
asyncModule: AsyncComponent<P>,
|
||||
asyncModule: AsyncComponentLoader<P> | AsyncComponent<P>,
|
||||
options: NextDynamicOptions<P>
|
||||
): DynamicComponent<P>;
|
||||
|
||||
|
||||
7
types/next-server/test/imports/no-default.tsx
Normal file
7
types/next-server/test/imports/no-default.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as React from "react";
|
||||
|
||||
interface Props {
|
||||
foo: string;
|
||||
}
|
||||
|
||||
export const MyComponent: React.SFC<Props> = ({ foo: text }) => <span>{text}</span>;
|
||||
11
types/next-server/test/imports/with-default.tsx
Normal file
11
types/next-server/test/imports/with-default.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from "react";
|
||||
|
||||
interface Props {
|
||||
foo: boolean;
|
||||
}
|
||||
|
||||
export default class MyComponent extends React.Component<Props> {
|
||||
render() {
|
||||
return this.props.foo ? <div/> : null;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,7 @@
|
||||
import * as React from "react";
|
||||
import dynamic, { LoadingComponentProps } from "next-server/dynamic";
|
||||
|
||||
// You'd typically do this via import('./MyComponent')
|
||||
interface MyComponentProps {
|
||||
foo: string;
|
||||
}
|
||||
const MyComponent: React.StatelessComponent<MyComponentProps> = () => <div>I'm async!</div>;
|
||||
const asyncComponent = Promise.resolve(MyComponent);
|
||||
const asyncComponent = import('./imports/with-default');
|
||||
|
||||
// Examples from
|
||||
// https://github.com/zeit/next.js/#dynamic-import
|
||||
@@ -17,30 +12,31 @@ const LoadingComponent: React.StatelessComponent<LoadingComponentProps> = ({
|
||||
}) => <p>loading...</p>;
|
||||
|
||||
// 1. Basic Usage (Also does SSR)
|
||||
const DynamicComponent = dynamic(asyncComponent);
|
||||
const dynamicComponentJSX = <DynamicComponent foo="bar" />;
|
||||
const Test1 = dynamic(asyncComponent);
|
||||
const test1JSX = <Test1 foo />;
|
||||
|
||||
// 1.1 Basic Usage (Loader function)
|
||||
const DynamicComponent2 = dynamic(() => asyncComponent);
|
||||
const dynamicComponent2JSX = <DynamicComponent2 foo="bar" />;
|
||||
const Test1Func = dynamic(() => asyncComponent);
|
||||
const test1FuncJSX = <Test1Func foo />;
|
||||
|
||||
// 2. With Custom Loading Component
|
||||
const DynamicComponentWithCustomLoading = dynamic(asyncComponent, {
|
||||
loading: LoadingComponent
|
||||
});
|
||||
const dynamicComponentWithCustomLoadingJSX = <DynamicComponentWithCustomLoading foo="bar" />;
|
||||
|
||||
// 3. With No SSR
|
||||
const DynamicComponentWithNoSSR = dynamic(asyncComponent, {
|
||||
// 2. With Custom Options
|
||||
const Test2 = dynamic(() => asyncComponent, {
|
||||
loading: LoadingComponent,
|
||||
ssr: false
|
||||
});
|
||||
const test2JSX = <Test2 foo />;
|
||||
|
||||
// 4. With Multiple Modules At Once
|
||||
const HelloBundle = dynamic<MyComponentProps>({
|
||||
// TODO: Mapped components still doesn't infer their props.
|
||||
interface BundleComponentProps {
|
||||
foo: string;
|
||||
}
|
||||
|
||||
const HelloBundle = dynamic<BundleComponentProps>({
|
||||
modules: () => {
|
||||
const components = {
|
||||
Hello1: asyncComponent,
|
||||
Hello2: asyncComponent
|
||||
Hello1: () => asyncComponent,
|
||||
Hello2: () => asyncComponent
|
||||
};
|
||||
|
||||
return components;
|
||||
@@ -64,6 +60,6 @@ const LoadableComponent = dynamic({
|
||||
});
|
||||
|
||||
// 6. No loading
|
||||
const DynamicComponentWithNoLoading = dynamic(asyncComponent, {
|
||||
const DynamicComponentWithNoLoading = dynamic(() => asyncComponent, {
|
||||
loading: () => null
|
||||
});
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
"test/next-server-head-tests.tsx",
|
||||
"test/next-server-link-tests.tsx",
|
||||
"test/next-server-dynamic-tests.tsx",
|
||||
"test/next-server-router-tests.tsx"
|
||||
"test/next-server-router-tests.tsx",
|
||||
"test/imports/no-default.tsx",
|
||||
"test/imports/with-default.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import {
|
||||
PHASE_DEVELOPMENT_SERVER,
|
||||
IS_BUNDLED_PAGE_REGEX
|
||||
} from "next/constants";
|
||||
|
||||
const isIndexPage = IS_BUNDLED_PAGE_REGEX.test(
|
||||
"static/CjW0mFnyG80HdP4eSUiy7/pages/index.js"
|
||||
);
|
||||
|
||||
// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md
|
||||
const config = (nextConfig: any = {}) => {
|
||||
return {
|
||||
...nextConfig,
|
||||
|
||||
// define in which phases this plugin should get applied.
|
||||
// you can also use multiple phases or negate them.
|
||||
// however, users can still overwrite them in their configuration if they really want to.
|
||||
phases: [PHASE_DEVELOPMENT_SERVER],
|
||||
|
||||
webpack(config: any, options: any) {
|
||||
// do something here which only gets applied during development server phase
|
||||
|
||||
if (typeof nextConfig.webpack === "function") {
|
||||
return nextConfig.webpack(config, options);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
import * as React from "react";
|
||||
import dynamic, { LoadingComponentProps } from "next/dynamic";
|
||||
|
||||
// You'd typically do this via import('./MyComponent')
|
||||
interface MyComponentProps {
|
||||
foo: string;
|
||||
}
|
||||
const MyComponent: React.FunctionComponent<MyComponentProps> = () => <div>I'm async!</div>;
|
||||
const asyncComponent = Promise.resolve(MyComponent);
|
||||
|
||||
// Examples from
|
||||
// https://github.com/zeit/next.js/#dynamic-import
|
||||
|
||||
const LoadingComponent: React.StatelessComponent<LoadingComponentProps> = ({
|
||||
isLoading,
|
||||
error
|
||||
}) => <p>loading...</p>;
|
||||
|
||||
// 1. Basic Usage (Also does SSR)
|
||||
const DynamicComponent = dynamic(asyncComponent);
|
||||
const dynamicComponentJSX = <DynamicComponent foo="bar" />;
|
||||
|
||||
// 2. With Custom Loading Component
|
||||
const DynamicComponentWithCustomLoading = dynamic(asyncComponent, {
|
||||
loading: LoadingComponent
|
||||
});
|
||||
const dynamicComponentWithCustomLoadingJSX = <DynamicComponentWithCustomLoading foo="bar" />;
|
||||
|
||||
// 3. With No SSR
|
||||
const DynamicComponentWithNoSSR = dynamic(asyncComponent, {
|
||||
ssr: false
|
||||
});
|
||||
|
||||
// 4. With Multiple Modules At Once
|
||||
const HelloBundle = dynamic<MyComponentProps>({
|
||||
modules: () => {
|
||||
const components = {
|
||||
Hello1: asyncComponent,
|
||||
Hello2: asyncComponent
|
||||
};
|
||||
|
||||
return components;
|
||||
},
|
||||
render: (props, { Hello1, Hello2 }) => (
|
||||
<div>
|
||||
<h1>{props.foo}</h1>
|
||||
<Hello1 />
|
||||
<Hello2 />
|
||||
</div>
|
||||
)
|
||||
});
|
||||
const helloBundleJSX = <HelloBundle foo="bar" />;
|
||||
|
||||
// 5. With plain Loadable options
|
||||
const LoadableComponent = dynamic({
|
||||
loader: () => asyncComponent,
|
||||
loading: LoadingComponent,
|
||||
delay: 200,
|
||||
timeout: 10000
|
||||
});
|
||||
|
||||
// 6. No loading
|
||||
const DynamicComponentWithNoLoading = dynamic(asyncComponent, {
|
||||
loading: () => null
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
import Head, * as head from "next/head";
|
||||
import * as React from "react";
|
||||
|
||||
const elements: JSX.Element[] = head.defaultHead();
|
||||
const jsx = <Head>{elements}</Head>;
|
||||
|
||||
if (!Head.canUseDOM) {
|
||||
Head.rewind().map(x => [x.key, x.props, x.type]);
|
||||
}
|
||||
|
||||
Head.peek().map(x => [x.key, x.props, x.type]);
|
||||
@@ -1,23 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import * as React from "react";
|
||||
|
||||
const links = (
|
||||
<div>
|
||||
<Link
|
||||
as="foo"
|
||||
href="https://www.example.com"
|
||||
onError={(e: any) => {
|
||||
console.log("Handled error!", e);
|
||||
}}
|
||||
prefetch
|
||||
replace
|
||||
scroll
|
||||
shallow
|
||||
>
|
||||
<a>Gotta link to somewhere!</a>
|
||||
</Link>
|
||||
<Link>
|
||||
<a>All props are optional!</a>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
@@ -1,110 +0,0 @@
|
||||
import Router, { withRouter, WithRouterProps } from "next/router";
|
||||
import * as React from "react";
|
||||
import * as qs from "querystring";
|
||||
|
||||
Router.readyCallbacks.push(() => {
|
||||
console.log("I'll get called when the router initializes.");
|
||||
});
|
||||
Router.ready(() => {
|
||||
console.log(
|
||||
"I'll get called immediately if the router initializes, or when it eventually does.",
|
||||
);
|
||||
});
|
||||
|
||||
// Access readonly properties of the router.
|
||||
|
||||
Object.keys(Router.components).forEach(key => {
|
||||
const c = Router.components[key];
|
||||
c.err.isAnAny;
|
||||
|
||||
return <c.Component />;
|
||||
});
|
||||
|
||||
function split(routeLike: string) {
|
||||
routeLike.split("/").forEach(part => {
|
||||
console.log("path part: ", part);
|
||||
});
|
||||
}
|
||||
|
||||
if (Router.asPath) {
|
||||
split(Router.asPath);
|
||||
split(Router.asPath);
|
||||
}
|
||||
|
||||
split(Router.pathname);
|
||||
|
||||
const query = `?${qs.stringify(Router.query)}`;
|
||||
|
||||
// Assign some callback methods.
|
||||
Router.events.on('routeChangeStart', (url: string) => console.log("Route is starting to change.", url));
|
||||
Router.events.on('beforeHistoryChange', (as: string) => console.log("History hasn't changed yet.", as));
|
||||
Router.events.on('routeChangeComplete', (url: string) => console.log("Route change is complete.", url));
|
||||
Router.events.on('routeChangeError', (err: any, url: string) => console.log("Route change errored.", err, url));
|
||||
|
||||
// Call methods on the router itself.
|
||||
Router.reload("/route").then(() => console.log("route was reloaded"));
|
||||
Router.back();
|
||||
Router.beforePopState(({ url }) => !!url);
|
||||
|
||||
Router.push("/route").then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
Router.push("/route", "/asRoute").then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
|
||||
Router.replace("/route").then((success: boolean) =>
|
||||
console.log("route replace success: ", success),
|
||||
);
|
||||
Router.replace("/route", "/asRoute").then((success: boolean) =>
|
||||
console.log("route replace success: ", success),
|
||||
);
|
||||
Router.replace("/route", "/asRoute", {
|
||||
shallow: false,
|
||||
}).then((success: boolean) => console.log("route replace success: ", success));
|
||||
|
||||
Router.prefetch("/route").then(Component => {
|
||||
const element = <Component />;
|
||||
});
|
||||
|
||||
interface TestComponentProps {
|
||||
testValue: string;
|
||||
}
|
||||
|
||||
class TestComponent extends React.Component<TestComponentProps & WithRouterProps> {
|
||||
state = { ready: false };
|
||||
|
||||
constructor(props: TestComponentProps & WithRouterProps) {
|
||||
super(props);
|
||||
if (props.router) {
|
||||
props.router.ready(() => {
|
||||
this.setState({ ready: true });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h1>{this.state.ready ? 'Ready' : 'Not Ready'}</h1>
|
||||
<h2>Route: {this.props.router ? this.props.router.route : ""}</h2>
|
||||
<p>Another prop: {this.props.testValue}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
withRouter(TestComponent);
|
||||
|
||||
interface TestFCQuery {
|
||||
test?: string;
|
||||
}
|
||||
|
||||
interface TestFCProps extends WithRouterProps<TestFCQuery> { }
|
||||
|
||||
const TestFC: React.FunctionComponent<TestFCProps> = ({ router }) => {
|
||||
return <div>{router && router.query && router.query.test}</div>;
|
||||
};
|
||||
@@ -30,14 +30,9 @@
|
||||
"router.d.ts",
|
||||
"config.d.ts",
|
||||
"test/next-tests.ts",
|
||||
"test/next-constants-tests.ts",
|
||||
"test/next-app-tests.tsx",
|
||||
"test/next-error-tests.tsx",
|
||||
"test/next-head-tests.tsx",
|
||||
"test/next-document-tests.tsx",
|
||||
"test/next-link-tests.tsx",
|
||||
"test/next-dynamic-tests.tsx",
|
||||
"test/next-router-tests.tsx",
|
||||
"test/next-component-tests.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
1
types/node-cache/index.d.ts
vendored
1
types/node-cache/index.d.ts
vendored
@@ -283,3 +283,4 @@ declare class NodeCache extends events.EventEmitter implements NodeCache.NodeCac
|
||||
}
|
||||
|
||||
export = NodeCache;
|
||||
export as namespace NodeCache;
|
||||
|
||||
36
types/npm-registry-package-info/index.d.ts
vendored
Normal file
36
types/npm-registry-package-info/index.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// Type definitions for npm-registry-package-info 1.0
|
||||
// Project: https://github.com/kgryte/npm-registry-package-info#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace pkginfo {
|
||||
interface Options {
|
||||
/** Boolean indicating whether to return only the latest package information from a registry. */
|
||||
latest?: boolean;
|
||||
/** Array of package names (required). */
|
||||
packages: string[];
|
||||
/** Registry port. Default: 443 (HTTPS) or 80 (HTTP). */
|
||||
port?: number;
|
||||
/** Registry protocol. Default: 'https'. */
|
||||
protocol?: 'http' | 'https';
|
||||
/** Registry. Default: 'registry.npmjs.org'. */
|
||||
registry?: string;
|
||||
}
|
||||
|
||||
interface Data {
|
||||
data: any;
|
||||
meta: {
|
||||
failure: number;
|
||||
success: number;
|
||||
total: number;
|
||||
};
|
||||
}
|
||||
|
||||
type Callback = (error: Error | null, data: Data) => void;
|
||||
|
||||
function factory(opts: Options, callback: Callback): () => void;
|
||||
}
|
||||
|
||||
declare function pkginfo(opts: pkginfo.Options, callback: pkginfo.Callback): void;
|
||||
|
||||
export = pkginfo;
|
||||
@@ -0,0 +1,21 @@
|
||||
import pkginfo = require('npm-registry-package-info');
|
||||
|
||||
const opts: pkginfo.Options = {
|
||||
latest: true,
|
||||
packages: ['dstructs-array', 'flow-map', 'utils-merge2'],
|
||||
port: 80,
|
||||
protocol: 'http',
|
||||
registry: 'my.favorite.npm/registry',
|
||||
};
|
||||
|
||||
pkginfo(opts, (error, data) => {
|
||||
data; // $ExpectType Data
|
||||
});
|
||||
|
||||
const pkgs = ['dstructs-matrix', 'compute-stdev', 'compute-variance'];
|
||||
|
||||
const get = pkginfo.factory({ packages: pkgs }, (error, data) => {
|
||||
data; // $ExpectType Data
|
||||
});
|
||||
|
||||
get();
|
||||
23
types/npm-registry-package-info/tsconfig.json
Normal file
23
types/npm-registry-package-info/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"npm-registry-package-info-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/npm-registry-package-info/tslint.json
Normal file
1
types/npm-registry-package-info/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
4
types/npm/index.d.ts
vendored
4
types/npm/index.d.ts
vendored
@@ -167,8 +167,8 @@ declare namespace NPM {
|
||||
Conf: ConfigStatic;
|
||||
defs: ConfigDefs;
|
||||
|
||||
get(setting: string): string;
|
||||
set(setting: string, value: string): void;
|
||||
get(setting: string): any;
|
||||
set(setting: string, value: any): void;
|
||||
|
||||
loadPrefix(cb: ErrorCallback): void;
|
||||
loadCAFile(caFilePath: string, cb: ErrorCallback): void;
|
||||
|
||||
@@ -22,4 +22,6 @@ npm.load({}, function (er) {
|
||||
npm.on("log", function (message: string) {
|
||||
console.log(message);
|
||||
});
|
||||
|
||||
npm.config.set('audit', false);
|
||||
})
|
||||
|
||||
2516
types/office-js-preview/index.d.ts
vendored
2516
types/office-js-preview/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2516
types/office-js/index.d.ts
vendored
2516
types/office-js/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
47
types/p-throttle/index.d.ts
vendored
47
types/p-throttle/index.d.ts
vendored
@@ -1,47 +0,0 @@
|
||||
// Type definitions for p-throttle 1.1
|
||||
// Project: https://github.com/sindresorhus/p-throttle#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = pThrottle;
|
||||
|
||||
declare function pThrottle<R>(fn: () => PromiseLike<R> | R, limit: number, interval: number): (() => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1>(fn: (arg1: T1) => PromiseLike<R> | R, limit: number, interval: number): ((arg1: T1) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2>(fn: (arg1: T1, arg2: T2) => PromiseLike<R> | R, limit: number, interval: number): ((arg1: T1, arg2: T2) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5, T6>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5, T6, T7>(
|
||||
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5, T6, T7, T8>(
|
||||
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
|
||||
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
|
||||
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => PromiseLike<R> | R,
|
||||
limit: number,
|
||||
interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => Promise<R>) & { abort(): void; };
|
||||
declare function pThrottle<R>(fn: (...args: any[]) => PromiseLike<R> | R, limit: number, interval: number): ((...args: any[]) => Promise<R>) & { abort(): void; };
|
||||
|
||||
declare namespace pThrottle {
|
||||
class AbortError extends Error {
|
||||
readonly name: 'AbortError';
|
||||
|
||||
constructor();
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import pThrottle = require('p-throttle');
|
||||
|
||||
const now = Date.now();
|
||||
|
||||
const throttled = pThrottle((i: number) => {
|
||||
const secDiff = ((Date.now() - now) / 1000).toFixed();
|
||||
return Promise.resolve(`${i}: ${secDiff}s`);
|
||||
}, 2, 1000);
|
||||
|
||||
for (let i = 1; i <= 6; i++) {
|
||||
throttled(i).then(res => {
|
||||
const str: string = res;
|
||||
});
|
||||
}
|
||||
|
||||
throttled.abort();
|
||||
|
||||
pThrottle(() => true, 2, 3).abort();
|
||||
pThrottle(() => true, 2, 3)();
|
||||
pThrottle((n: number, s: string) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string) => true, 2, 3)(1, 's');
|
||||
pThrottle((n: number, s: string, b: boolean) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean) => true, 2, 3)(1, 's', true);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3)(1, 's', true, 1);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3)(1, 's', true, 1, 's');
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3)(1, 's', true, 1, 's', false);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3);
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3).abort();
|
||||
pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3, 4);
|
||||
pThrottle(
|
||||
(n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true,
|
||||
2,
|
||||
3).abort();
|
||||
pThrottle(
|
||||
(n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true,
|
||||
2,
|
||||
3)(1, 's', true, 1, 's', false, 1, 2, 3, 4, 'as');
|
||||
|
||||
throw new pThrottle.AbortError();
|
||||
2
types/parse-unit/index.d.ts
vendored
2
types/parse-unit/index.d.ts
vendored
@@ -3,5 +3,5 @@
|
||||
// Definitions by: Jack Works <https://github.com/Jack-Works>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function parse(value: string): [number, string];
|
||||
declare function parse(value: string | number): [number, string];
|
||||
export = parse;
|
||||
|
||||
@@ -2,3 +2,7 @@ import parse = require('parse-unit');
|
||||
const [number, length] = parse('10px');
|
||||
number === 50;
|
||||
length === 'px';
|
||||
|
||||
parse(10).length === 2;
|
||||
parse(10)[0] === 10;
|
||||
parse(10)[1] === '';
|
||||
|
||||
34
types/postcss-nested/index.d.ts
vendored
Normal file
34
types/postcss-nested/index.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Type definitions for postcss-nested 4.1
|
||||
// Project: https://github.com/postcss/postcss-nested#readme
|
||||
// Definitions by: Maxim Vorontsov <https://github.com/VorontsovMaxim>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Plugin } from 'postcss';
|
||||
|
||||
declare namespace nested {
|
||||
interface Options {
|
||||
/**
|
||||
* By default, plugin will bubble only @media and @supports at-rules.
|
||||
* You can add your custom at-rules to this list by this option.
|
||||
*/
|
||||
bubble?: string[];
|
||||
|
||||
/**
|
||||
* By default, plugin will unwrap only @font-face, @keyframes and @document at-rules.
|
||||
* You can add your custom at-rules to this list by this option.
|
||||
*/
|
||||
unwrap?: string[];
|
||||
|
||||
/**
|
||||
* By default, plugin will strip out any empty selector generated by intermediate nesting
|
||||
* levels. You can set this option to true to preserve them.
|
||||
*/
|
||||
preserveEmpty?: boolean;
|
||||
}
|
||||
|
||||
type Nested = Plugin<Options>;
|
||||
}
|
||||
|
||||
declare const nested: nested.Nested;
|
||||
export = nested;
|
||||
6
types/postcss-nested/package.json
Normal file
6
types/postcss-nested/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"postcss": "7.x.x"
|
||||
}
|
||||
}
|
||||
12
types/postcss-nested/postcss-nested-tests.ts
Normal file
12
types/postcss-nested/postcss-nested-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as postcss from 'postcss';
|
||||
import nested = require('postcss-nested');
|
||||
|
||||
const withDefaultOptions: postcss.Transformer = nested();
|
||||
const withCustomOptions: postcss.Transformer = nested({
|
||||
bubble: ['phone'],
|
||||
unwrap: ['phone'],
|
||||
preserveEmpty: true
|
||||
});
|
||||
|
||||
postcss().use(withDefaultOptions);
|
||||
postcss().use(withCustomOptions);
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"p-throttle-tests.ts"
|
||||
"postcss-nested-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
types/postcss-nested/tslint.json
Normal file
1
types/postcss-nested/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
12
types/pretty/index.d.ts
vendored
Normal file
12
types/pretty/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for pretty 2.0
|
||||
// Project: https://github.com/jonschlinkert/pretty
|
||||
// Definitions by: Adam Zerella <https://github.com/adamzerella>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface PrettyOptions {
|
||||
ocd: boolean;
|
||||
}
|
||||
|
||||
declare function pretty(str: string, options?: PrettyOptions): string;
|
||||
|
||||
export = pretty;
|
||||
5
types/pretty/pretty-tests.ts
Normal file
5
types/pretty/pretty-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import pretty = require("pretty");
|
||||
|
||||
pretty(`<h1>nice</h1>`);
|
||||
|
||||
pretty(`<h1>nice</h1>`, {ocd: true});
|
||||
25
types/pretty/tsconfig.json
Normal file
25
types/pretty/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
|
||||
],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pretty-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/pretty/tslint.json
Normal file
3
types/pretty/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
4
types/raygun/index.d.ts
vendored
4
types/raygun/index.d.ts
vendored
@@ -4,7 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare namespace raygun {
|
||||
export namespace raygun {
|
||||
interface KeyValueObject {
|
||||
[key: string]: string | number | boolean | KeyValueObject;
|
||||
}
|
||||
@@ -143,4 +143,4 @@ declare class Client {
|
||||
): void;
|
||||
}
|
||||
|
||||
export = Client;
|
||||
export { Client };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Client = require('raygun');
|
||||
import raygun = require('raygun');
|
||||
|
||||
const client = new Client(); // $ExpectType Client
|
||||
const client = new raygun.Client(); // $ExpectType Client
|
||||
client.init({apiKey: '1'}); // $ExpectType Client
|
||||
|
||||
client.init(); // $ExpectError
|
||||
|
||||
4
types/react-aria-menubutton/index.d.ts
vendored
4
types/react-aria-menubutton/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-aria-menubutton 6.1
|
||||
// Type definitions for react-aria-menubutton 6.2
|
||||
// Project: https://github.com/davidtheclark/react-aria-menubutton
|
||||
// Definitions by: Muhammad Fawwaz Orabi <https://github.com/forabi>
|
||||
// Chris Rohlfs <https://github.com/crohlfs>
|
||||
@@ -100,7 +100,7 @@ export interface MenuItemProps<T extends HTMLElement>
|
||||
* If value has a value, it will be passed to the onSelection handler
|
||||
* when the `MenuItem` is selected
|
||||
*/
|
||||
value?: string | boolean | number;
|
||||
value?: any;
|
||||
|
||||
/**
|
||||
* If `text` has a value, its first letter will be the letter a user can
|
||||
|
||||
@@ -121,3 +121,18 @@ closeMenu("", { focusMenu: true });
|
||||
|
||||
openMenu("");
|
||||
openMenu("", { focusMenu: true });
|
||||
|
||||
class ObjectMenuItem extends React.Component {
|
||||
render() {
|
||||
const itemValue = { name: "Test name", label: "Only item to select" };
|
||||
return (
|
||||
<Wrapper onSelection={(value) => console.log(value.name)}>
|
||||
<li>
|
||||
<MenuItem value={itemValue} >{itemValue.label}</MenuItem>
|
||||
</li>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<ObjectMenuItem />, document.body);
|
||||
|
||||
5
types/react-draft-wysiwyg/index.d.ts
vendored
5
types/react-draft-wysiwyg/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/jpuri/react-draft-wysiwyg#readme
|
||||
// Definitions by: imechZhangLY <https://github.com/imechZhangLY>
|
||||
// brunoMaurice <https://github.com/brunoMaurice>
|
||||
// ldanet <https://github.com/ldanet>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -18,9 +19,9 @@ export class ContentBlock extends Draft.ContentBlock {}
|
||||
export class SelectionState extends Draft.SelectionState {}
|
||||
|
||||
export interface EditorProps {
|
||||
onChange?(contentState: ContentState): RawDraftContentState;
|
||||
onChange?(contentState: RawDraftContentState): void;
|
||||
onEditorStateChange?(editorState: EditorState): void;
|
||||
onContentStateChange?(contentState: ContentState): RawDraftContentState;
|
||||
onContentStateChange?(contentState: RawDraftContentState): void;
|
||||
initialContentState?: RawDraftContentState;
|
||||
defaultContentState?: RawDraftContentState;
|
||||
contentState?: RawDraftContentState;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// From https://github.com/jpuri/react-draft-wysiwyg/blob/master/docs/src/components/Docs/Props/EditorStateProp/index.js#L125
|
||||
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import { Editor, RawDraftContentState } from "react-draft-wysiwyg";
|
||||
|
||||
class UncontrolledEditor extends React.Component<
|
||||
{},
|
||||
{ contentState: RawDraftContentState }
|
||||
> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
this.state = {
|
||||
contentState: JSON.parse(`{
|
||||
"entityMap":{},
|
||||
"blocks":[{
|
||||
"key":"1ljs",
|
||||
"text":"Initializing from content state",
|
||||
"type":"unstyled",
|
||||
"depth":0,
|
||||
"inlineStyleRanges":[],
|
||||
"entityRanges":[],
|
||||
"data":{}
|
||||
}]
|
||||
}`)
|
||||
};
|
||||
}
|
||||
|
||||
onContentStateChange = (contentState: RawDraftContentState) => {
|
||||
this.setState({
|
||||
contentState
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { contentState } = this.state;
|
||||
return (
|
||||
<Editor
|
||||
initialContentState={contentState}
|
||||
wrapperClassName="demo-wrapper"
|
||||
editorClassName="demo-editor"
|
||||
onContentStateChange={this.onContentStateChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<UncontrolledEditor />, document.getElementById("target"));
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user