mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge branch 'master' into use-dtslint-from-npm
This commit is contained in:
Vendored
+2
@@ -489,6 +489,8 @@ declare namespace IORedis {
|
||||
xack(key: KeyType, group: string, ...ids: string[]): any;
|
||||
|
||||
xadd(key: KeyType, id: string, ...args: string[]): any;
|
||||
xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', count: number, ...args: string[]): any;
|
||||
xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', approximate: '~', count: number, ...args: string[]): any;
|
||||
|
||||
xclaim(key: KeyType, group: string, consumer: string, minIdleTime: number, ...args: any[]): any;
|
||||
|
||||
|
||||
@@ -177,6 +177,8 @@ new Redis.Cluster([{
|
||||
|
||||
redis.xack('streamName', 'groupName', 'id');
|
||||
redis.xadd('streamName', '*', 'field', 'name');
|
||||
redis.xadd('streamName', 'MAXLEN', 100, '*', 'field', 'name');
|
||||
redis.xadd('streamName', 'MAXLEN', '~', 100, '*', 'field', 'name');
|
||||
redis.xclaim('streamName', 'groupName', 'consumerName', 3600000, 'id');
|
||||
redis.xdel('streamName', 'id');
|
||||
redis.xgroup('CREATE', 'streamName', 'groupName', '$');
|
||||
|
||||
Vendored
+161
-16
@@ -1,54 +1,199 @@
|
||||
// Type definitions for jsoneditor v5.19.0
|
||||
// Type definitions for jsoneditor v5.28.2
|
||||
// Project: https://github.com/josdejong/jsoneditor
|
||||
// Definitions by: Alejandro Sánchez <https://github.com/alejo90>
|
||||
// Errietta Kostala <https://github.com/errietta>
|
||||
// Adam Vigneaux <https://github.com/adamvig>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="ace" />
|
||||
|
||||
import { Ajv } from "ajv";
|
||||
|
||||
declare module 'jsoneditor' {
|
||||
export interface JSONEditorNode {
|
||||
type JSONPath = (string|number)[];
|
||||
|
||||
export interface Node {
|
||||
field: string;
|
||||
value: string;
|
||||
path: Array<string>;
|
||||
value?: string;
|
||||
path: JSONPath;
|
||||
}
|
||||
|
||||
export type JSONEditorMode = 'tree' | 'view' | 'form' | 'code' | 'text';
|
||||
|
||||
export interface NodeName {
|
||||
path: string;
|
||||
type: 'object'|'array';
|
||||
size: number;
|
||||
}
|
||||
|
||||
export interface ValidationError {
|
||||
path: JSONPath;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
text: string;
|
||||
title: string;
|
||||
className?: string;
|
||||
field: string;
|
||||
value: any;
|
||||
}
|
||||
|
||||
export type AutoCompleteCompletion = null|string[]|{startFrom: number, options: string[]};
|
||||
|
||||
export type AutoCompleteOptionsGetter = (
|
||||
text: string, path: JSONPath, input: string, editor: JSONEditor,
|
||||
) => AutoCompleteCompletion|Promise<AutoCompleteCompletion>;
|
||||
|
||||
export interface AutoCompleteOptions {
|
||||
/**
|
||||
* @default [39, 35, 9]
|
||||
*/
|
||||
confirmKeys?: number[];
|
||||
caseSensitive?: boolean;
|
||||
getOptions?: AutoCompleteOptionsGetter;
|
||||
}
|
||||
|
||||
export interface SelectionPosition {
|
||||
row: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface SerializableNode {
|
||||
value: any;
|
||||
path: JSONPath;
|
||||
}
|
||||
|
||||
// Based on the API of https://github.com/Sphinxxxx/vanilla-picker
|
||||
export interface Color {
|
||||
rgba: Array<number>;
|
||||
hsla: Array<number>;
|
||||
rgbString: string;
|
||||
rgbaString: string;
|
||||
hslString: string;
|
||||
hslaString: string;
|
||||
hex: string;
|
||||
}
|
||||
|
||||
export interface JSONEditorOptions {
|
||||
ace?: AceAjax.Ace;
|
||||
ajv?: any; // Any for now, since ajv typings aren't A-Ok
|
||||
ajv?: Ajv;
|
||||
onChange?: () => void;
|
||||
onEditable?: (node: JSONEditorNode) => boolean | {field: boolean, value: boolean};
|
||||
onChangeJSON?: (json: any) => void;
|
||||
onChangeText?: (jsonString: string) => void;
|
||||
onEditable?: (node: Node) => boolean|{field: boolean, value: boolean};
|
||||
onError?: (error: Error) => void;
|
||||
onModeChange?: (newMode: JSONEditorMode, oldMode: JSONEditorMode) => void;
|
||||
onNodeName?: (nodeName: NodeName) => string|undefined;
|
||||
onValidate?: (json: any) => ValidationError[]|Promise<ValidationError[]>;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
escapeUnicode?: boolean;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
sortObjectKeys?: boolean;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
history?: boolean;
|
||||
/**
|
||||
* @default 'tree'
|
||||
*/
|
||||
mode?: JSONEditorMode;
|
||||
modes?: Array<JSONEditorMode>;
|
||||
modes?: JSONEditorMode[];
|
||||
/**
|
||||
* @default undefined
|
||||
*/
|
||||
name?: string;
|
||||
schema?: Object;
|
||||
schemaRefs?: Object;
|
||||
schema?: object;
|
||||
schemaRefs?: object;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
search?: boolean;
|
||||
/**
|
||||
* @default 2
|
||||
*/
|
||||
indentation?: number;
|
||||
theme?: string;
|
||||
templates?: Template[];
|
||||
autocomplete?: AutoCompleteOptions;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
mainMenuBar?: boolean;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
navigationBar?: boolean;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
statusBar?: boolean;
|
||||
onTextSelectionChange?: (start: SelectionPosition, end: SelectionPosition, text: string) => void;
|
||||
onSelectionChange?: (start: SerializableNode, end: SerializableNode) => void;
|
||||
onEvent?: (node: Node, event: string) => void;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
colorPicker?: boolean;
|
||||
onColorPicker?: (parent: HTMLElement, color: string, onChange: (color: Color) => void) => void;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
timestampTag?: boolean;
|
||||
language?: string;
|
||||
languages?: {
|
||||
[lang: string]: {
|
||||
[key: string]: string;
|
||||
};
|
||||
};
|
||||
modalAnchor?: HTMLElement;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
enableSort?: boolean;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
enableTransform?: boolean;
|
||||
/**
|
||||
* @default 100
|
||||
*/
|
||||
maxVisibleChilds?: number;
|
||||
|
||||
}
|
||||
|
||||
export default class JSONEditor {
|
||||
constructor(container: HTMLElement, options?: JSONEditorOptions, json?: Object);
|
||||
constructor(container: HTMLElement, options?: JSONEditorOptions, json?: any);
|
||||
collapseAll(): void;
|
||||
destroy(): void;
|
||||
expandAll(): void;
|
||||
focus(): void;
|
||||
set(json: Object): void;
|
||||
setMode(mode: JSONEditorMode): void;
|
||||
setName(name?: string): void;
|
||||
setSchema(schema: Object): void;
|
||||
setText(jsonString: string): void;
|
||||
get(): any;
|
||||
getMode(): JSONEditorMode;
|
||||
getName(): string;
|
||||
getName(): string|undefined;
|
||||
getNodesByRange(start: {path: JSONPath}, end: {path: JSONPath}): Array<SerializableNode>;
|
||||
getSelection(): {start: SerializableNode, end: SerializableNode};
|
||||
getText(): string;
|
||||
getTextSelection(): {start: SelectionPosition, end: SelectionPosition, text: string};
|
||||
refresh(): void;
|
||||
set(json: any): void;
|
||||
setMode(mode: JSONEditorMode): void;
|
||||
setName(name?: string): void;
|
||||
setSchema(schema: object, schemaRefs?: object): void;
|
||||
setSelection(start: {path: JSONPath}, end: {path: JSONPath}): void;
|
||||
setText(jsonString: string): void;
|
||||
setTextSelection(start: SelectionPosition, end: SelectionPosition): void;
|
||||
update(json: any): void;
|
||||
updateText(jsonString: string): void;
|
||||
|
||||
static VALID_OPTIONS: Array<string>;
|
||||
static ace: AceAjax.Ace;
|
||||
static Ajv: Ajv;
|
||||
static VanillaPicker: any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import JSONEditor, {JSONEditorMode, JSONEditorNode, JSONEditorOptions } from 'jsoneditor';
|
||||
import * as Ajv from 'ajv';
|
||||
import JSONEditor, {JSONEditorMode, Node, JSONEditorOptions } from 'jsoneditor';
|
||||
|
||||
let options: JSONEditorOptions;
|
||||
options = {};
|
||||
options = {
|
||||
ace: ace,
|
||||
//ajv: Ajv({allErrors: true, verbose: true})
|
||||
ajv: new Ajv({allErrors: true, verbose: true}),
|
||||
onChange() {},
|
||||
onEditable(node: JSONEditorNode) {
|
||||
onEditable(node: Node) {
|
||||
return true;
|
||||
},
|
||||
onError(error: Error) {},
|
||||
@@ -23,7 +25,7 @@ options = {
|
||||
theme: 'default'
|
||||
};
|
||||
options = {
|
||||
onEditable(node: JSONEditorNode) {
|
||||
onEditable(node: Node) {
|
||||
return {field: true, value: false};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"ajv": "*"
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -21,7 +21,7 @@ export interface Options {
|
||||
*/
|
||||
animationData: any;
|
||||
rendererSettings?: {
|
||||
preserveAspectRatio?: boolean;
|
||||
preserveAspectRatio?: string;
|
||||
/**
|
||||
* The canvas context
|
||||
*/
|
||||
|
||||
Vendored
+4
-1
@@ -31,6 +31,7 @@
|
||||
// Fellipe Chagas <https://github.com/chagasaway>
|
||||
// Deniss Borisovs <https://github.com/denissb>
|
||||
// Kenneth Skovhus <https://github.com/skovhus>
|
||||
// Aaron Rosen <https://github.com/azrosen92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -623,7 +624,7 @@ export interface NavigationEventSubscription {
|
||||
}
|
||||
|
||||
export interface NavigationEventsProps extends ViewProps {
|
||||
navigation?: NavigationNavigator;
|
||||
navigation?: NavigationScreenProp<NavigationRoute>;
|
||||
onWillFocus?: NavigationEventCallback;
|
||||
onDidFocus?: NavigationEventCallback;
|
||||
onWillBlur?: NavigationEventCallback;
|
||||
@@ -1367,3 +1368,5 @@ export interface SafeAreaViewProps extends ViewProps {
|
||||
}
|
||||
|
||||
export const SafeAreaView: React.ComponentClass<SafeAreaViewProps>;
|
||||
|
||||
export const NavigationContext: React.Context<NavigationScreenProp<NavigationRoute>>;
|
||||
|
||||
@@ -42,6 +42,7 @@ import {
|
||||
HeaderBackButton,
|
||||
Header,
|
||||
NavigationContainer,
|
||||
NavigationContext,
|
||||
NavigationParams,
|
||||
NavigationPopAction,
|
||||
NavigationPopToTopAction,
|
||||
@@ -681,3 +682,14 @@ const ViewWithNavigationEvents = (
|
||||
onDidBlur={console.log}
|
||||
/>
|
||||
);
|
||||
|
||||
// Test NavigationContext
|
||||
const componentWithNavigationContext = (
|
||||
<NavigationContext.Consumer>
|
||||
{
|
||||
navigationContext => (
|
||||
<NavigationEvents navigation={navigationContext} />
|
||||
)
|
||||
}
|
||||
</NavigationContext.Consumer>
|
||||
);
|
||||
|
||||
Vendored
+30
-19
@@ -1,9 +1,9 @@
|
||||
// Type definitions for theo 8.1
|
||||
// Type definitions for Theo 8.1
|
||||
// Project: https://github.com/salesforce-ux/theo
|
||||
// Definitions by: Pete Petrash <https://github.com/petekp>
|
||||
// Niko Laitinen <https://github.com/laitine>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Collection, Map, List, OrderedMap } from "immutable";
|
||||
|
||||
@@ -35,21 +35,16 @@ export type Format =
|
||||
| "android.xml"
|
||||
| "aura.tokens";
|
||||
|
||||
export function convert(options: ConvertOptions): Promise<string>;
|
||||
export function convertSync(options: ConvertOptions): string;
|
||||
export function registerFormat(
|
||||
name: string,
|
||||
format: FormatResultFn | string
|
||||
): void;
|
||||
export function registerTransform(
|
||||
name: string,
|
||||
valueTransforms: string[]
|
||||
): void;
|
||||
export function registerValueTransform(
|
||||
name: string,
|
||||
predicate: (prop: Prop) => boolean,
|
||||
transform: (prop: Prop) => string | number
|
||||
): void;
|
||||
export type Transform = "raw" | "ios" | "android" | "web";
|
||||
|
||||
export type ValueTransform =
|
||||
| "color/rgb"
|
||||
| "color/hex"
|
||||
| "color/hex8rgba"
|
||||
| "color/hex8argb"
|
||||
| "percentage/float"
|
||||
| "relative/pixel"
|
||||
| "relative/pixelValue";
|
||||
|
||||
export type Prop = Map<StyleProperty, string | number>;
|
||||
export type Props = List<Prop>;
|
||||
@@ -78,8 +73,8 @@ export interface ConvertOptions {
|
||||
resolveMetaAliases?: boolean;
|
||||
}
|
||||
|
||||
export interface TransformOptions {
|
||||
type?: string;
|
||||
export interface TransformOptions<T extends string = never> {
|
||||
type?: Transform | T;
|
||||
file: string;
|
||||
data?: string;
|
||||
}
|
||||
@@ -91,3 +86,19 @@ export interface FormatOptions {
|
||||
transformPropName?: (name: string) => string
|
||||
) => void;
|
||||
}
|
||||
|
||||
export function convert(options: ConvertOptions): Promise<string>;
|
||||
export function convertSync(options: ConvertOptions): string;
|
||||
export function registerFormat<T extends string = never>(
|
||||
name: Format | T,
|
||||
format: FormatResultFn | string
|
||||
): void;
|
||||
export function registerTransform<T extends string = never>(
|
||||
name: Transform | T,
|
||||
valueTransforms: ValueTransform[] | T[]
|
||||
): void;
|
||||
export function registerValueTransform<T extends string = never>(
|
||||
name: ValueTransform | T,
|
||||
predicate: (prop: Prop) => boolean,
|
||||
transform: (prop: Prop) => string | number
|
||||
): void;
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user