mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
Merge branch 'master'
This commit is contained in:
@@ -247,7 +247,7 @@ new Chartist.Pie('.ct-chart', {
|
||||
value: 70,
|
||||
name: 'Series 3',
|
||||
className: 'my-custom-class-three',
|
||||
meta: 'Meta Three'
|
||||
meta: { description: 'Meta Three' }
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
4
types/chartist/index.d.ts
vendored
4
types/chartist/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Chartist v0.9.81
|
||||
// Project: https://github.com/gionkunz/chartist-js
|
||||
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>
|
||||
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>, Sunny Juneja <https://github.com/sunnyrjuneja>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Chartist {
|
||||
@@ -101,7 +101,7 @@ declare namespace Chartist {
|
||||
value?: number;
|
||||
data?: Array<number>;
|
||||
className?: string;
|
||||
meta?: string; // I assume this could probably be a number as well?
|
||||
meta?: any;
|
||||
}
|
||||
|
||||
interface IChartistBase<T extends IChartOptions> {
|
||||
|
||||
@@ -754,3 +754,9 @@ test('moduleName 2', () => {
|
||||
const moduleName = require('../moduleName');
|
||||
expect(moduleName()).toEqual(2);
|
||||
});
|
||||
|
||||
describe('toHaveBeenNthCalledWith', () => {
|
||||
const fn = jest.fn();
|
||||
|
||||
expect(fn).toHaveBeenNthCalledWith(3, "foo");
|
||||
});
|
||||
|
||||
4
types/nodegit/diff-binary-file.d.ts
vendored
4
types/nodegit/diff-binary-file.d.ts
vendored
@@ -1,5 +1,7 @@
|
||||
import { Object } from './object';
|
||||
|
||||
export class DiffBinaryFile {
|
||||
type: number;
|
||||
type: Object.TYPE;
|
||||
data: string;
|
||||
datalen: number;
|
||||
inflatedlen: number;
|
||||
|
||||
29
types/nodegit/object.d.ts
vendored
29
types/nodegit/object.d.ts
vendored
@@ -3,20 +3,35 @@ import { Repository } from './repository';
|
||||
import { Buf } from './buf';
|
||||
|
||||
export class Object {
|
||||
static size(type: number): number;
|
||||
static lookup(repo: Repository, id: Oid, type: number): Promise<Object>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise<Object>;
|
||||
static string2type(str: string): number;
|
||||
static type2string(type: number): string;
|
||||
static typeisloose(type: number): number;
|
||||
static size(type: Object.TYPE): number;
|
||||
static lookup(repo: Repository, id: Oid, type: Object.TYPE): Promise<Object>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number, type: Object.TYPE): Promise<Object>;
|
||||
static string2Type(str: string): Object.TYPE;
|
||||
static type2String(type: Object.TYPE): string;
|
||||
static typeisloose(type: Object.TYPE): number;
|
||||
|
||||
dup(): Promise<Object>;
|
||||
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
lookupByPath(path: string, type: number): Promise<Object>;
|
||||
lookupByPath(path: string, type: Object.TYPE): Promise<Object>;
|
||||
owner(): Repository;
|
||||
peel(targetType: number): Promise<Object>;
|
||||
shortId(): Promise<Buf>;
|
||||
type(): number;
|
||||
}
|
||||
|
||||
export namespace Object {
|
||||
const enum TYPE {
|
||||
ANY = -2,
|
||||
BAD = -1,
|
||||
EXT1 = 0,
|
||||
COMMIT = 1,
|
||||
TREE = 2,
|
||||
BLOB = 3,
|
||||
TAG = 4,
|
||||
EXT2 = 5,
|
||||
OFS_DELTA = 6,
|
||||
REF_DELTA = 7
|
||||
}
|
||||
}
|
||||
|
||||
3
types/nodegit/odb-expand-id.d.ts
vendored
3
types/nodegit/odb-expand-id.d.ts
vendored
@@ -1,7 +1,8 @@
|
||||
import { Oid } from './oid';
|
||||
import { Object } from './object';
|
||||
|
||||
export class OdbExpandId {
|
||||
id: Oid;
|
||||
length: number;
|
||||
type: number;
|
||||
type: Object.TYPE;
|
||||
}
|
||||
|
||||
3
types/nodegit/odb.d.ts
vendored
3
types/nodegit/odb.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
import { Oid } from './oid';
|
||||
import { OdbObject } from './odb-object';
|
||||
import { OdbExpandId } from './odb-expand-id';
|
||||
import { Object } from './object';
|
||||
|
||||
export namespace Odb {
|
||||
const enum STREAM {
|
||||
@@ -17,6 +18,6 @@ export class Odb {
|
||||
|
||||
free(): void;
|
||||
read(id: Oid): Promise<OdbObject>;
|
||||
write(data: Buffer, len: number, type: number): Promise<Oid>;
|
||||
write(data: Buffer, len: number, type: Object.TYPE): Promise<Oid>;
|
||||
expandIds(ids: OdbExpandId, count: number): number;
|
||||
}
|
||||
|
||||
2
types/nodegit/reference.d.ts
vendored
2
types/nodegit/reference.d.ts
vendored
@@ -41,7 +41,7 @@ export class Reference {
|
||||
isTag(): number;
|
||||
name(): string;
|
||||
owner(): Repository;
|
||||
peel(type: number): Promise<Object>;
|
||||
peel(type: Object.TYPE): Promise<Object>;
|
||||
rename(newName: string, force: number, logMessage: string): Promise<Reference>;
|
||||
resolve(): Promise<Reference>;
|
||||
setTarget(id: Oid, logMessage: string): Promise<Reference>;
|
||||
|
||||
1
types/react-native-auth0/index.d.ts
vendored
1
types/react-native-auth0/index.d.ts
vendored
@@ -137,6 +137,7 @@ export interface AuthorizeParams {
|
||||
nonce?: string;
|
||||
audience?: string;
|
||||
scope?: string;
|
||||
connection?: string;
|
||||
}
|
||||
|
||||
export interface ClearSessionParams {
|
||||
|
||||
1
types/react-native-datepicker/index.d.ts
vendored
1
types/react-native-datepicker/index.d.ts
vendored
@@ -30,6 +30,7 @@ export interface DatePickerProps {
|
||||
placeholder?: string;
|
||||
modalOnResponderTerminationRequest?(e: any): boolean;
|
||||
is24Hour?: boolean;
|
||||
getDateStr?: (date: Date) => string;
|
||||
style?: any;
|
||||
customStyles?: any;
|
||||
minuteInterval?: number;
|
||||
|
||||
22
types/react-native-material-textfield/index.d.ts
vendored
22
types/react-native-material-textfield/index.d.ts
vendored
@@ -1,11 +1,18 @@
|
||||
// Type definitions for react-native-material-textfield 0.12
|
||||
// Project: https://github.com/n4kz/react-native-material-textfield
|
||||
// Definitions by: Ville Venäläinen <https://github.com/mindhivefi>
|
||||
// Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from 'react';
|
||||
import { TextInputProps, TextStyle, ViewStyle, View } from 'react-native';
|
||||
import {
|
||||
StyleProp,
|
||||
TextInputProps,
|
||||
TextStyle,
|
||||
ViewStyle,
|
||||
View
|
||||
} from 'react-native';
|
||||
|
||||
export interface TextFieldProps extends TextInputProps {
|
||||
animationDuration?: number;
|
||||
@@ -17,9 +24,10 @@ export interface TextFieldProps extends TextInputProps {
|
||||
labelPadding?: number;
|
||||
inputContainerPadding?: number;
|
||||
|
||||
labelTextStyle?: TextStyle;
|
||||
titleTextStyle?: TextStyle;
|
||||
affixTextStyle?: TextStyle;
|
||||
style?: StyleProp<TextStyle>;
|
||||
labelTextStyle?: StyleProp<TextStyle>;
|
||||
titleTextStyle?: StyleProp<TextStyle>;
|
||||
affixTextStyle?: StyleProp<TextStyle>;
|
||||
|
||||
tintColor?: string;
|
||||
textColor?: string;
|
||||
@@ -47,8 +55,8 @@ export interface TextFieldProps extends TextInputProps {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
|
||||
containerStyle?: ViewStyle;
|
||||
inputContainerStyle?: ViewStyle;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
inputContainerStyle?: StyleProp<ViewStyle>;
|
||||
|
||||
onPress?(event: Event): void;
|
||||
onChangeText?(text: string): void;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import { View, Text } from 'react-native';
|
||||
import { View } from 'react-native';
|
||||
import { TextField } from 'react-native-material-textfield';
|
||||
|
||||
const Example = () =>
|
||||
const Example = () => (
|
||||
<View>
|
||||
<TextField
|
||||
label="Example"
|
||||
multiline
|
||||
placeholder="Text when field is empty"
|
||||
value="Initial value"
|
||||
style={{ fontSize: 10 }}
|
||||
/>
|
||||
</View>;
|
||||
</View>
|
||||
);
|
||||
|
||||
4
types/react-native-snap-carousel/index.d.ts
vendored
4
types/react-native-snap-carousel/index.d.ts
vendored
@@ -45,6 +45,10 @@ export interface CarouselProps<T> extends React.Props<ScrollViewProps> {
|
||||
* Width in pixels of your slides, must be the same for all of them
|
||||
* Note: Required with horizontal carousel
|
||||
*/
|
||||
/**
|
||||
* Reverses the direction of scroll. Uses scale transforms of -1.
|
||||
*/
|
||||
inverted?: boolean;
|
||||
itemWidth?: number;
|
||||
/**
|
||||
* Height in pixels of carousel's items, must be the same for all of them
|
||||
|
||||
10
types/react-native/index.d.ts
vendored
10
types/react-native/index.d.ts
vendored
@@ -1078,6 +1078,12 @@ export type ReturnKeyTypeAndroid = "none" | "previous";
|
||||
export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call";
|
||||
export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS
|
||||
|
||||
export interface TextInputFocusEventData {
|
||||
target: number,
|
||||
text: string,
|
||||
eventCount: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/textinput.html#props
|
||||
*/
|
||||
@@ -1159,7 +1165,7 @@ export interface TextInputProps
|
||||
/**
|
||||
* Callback that is called when the text input is blurred
|
||||
*/
|
||||
onBlur?: () => void;
|
||||
onBlur?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input's text changes.
|
||||
@@ -1198,7 +1204,7 @@ export interface TextInputProps
|
||||
/**
|
||||
* Callback that is called when the text input is focused
|
||||
*/
|
||||
onFocus?: () => void;
|
||||
onFocus?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input selection is changed.
|
||||
|
||||
@@ -49,8 +49,10 @@ import {
|
||||
NativeModules,
|
||||
MaskedViewIOS,
|
||||
TextInput,
|
||||
TextInputFocusEventData,
|
||||
InputAccessoryView,
|
||||
StatusBar
|
||||
StatusBar,
|
||||
NativeSyntheticEvent
|
||||
} from "react-native";
|
||||
|
||||
declare module "react-native" {
|
||||
@@ -447,6 +449,25 @@ class TextInputRefTest extends React.Component<{}, {username: string}> {
|
||||
}
|
||||
}
|
||||
|
||||
class TextInputFocusBlurEventTest extends React.Component {
|
||||
handleOnBlur(e: NativeSyntheticEvent<TextInputFocusEventData>) {
|
||||
}
|
||||
|
||||
handleOnFocus(e: NativeSyntheticEvent<TextInputFocusEventData>) {
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
onBlur={(e: NativeSyntheticEvent<TextInputFocusEventData>) => this.handleOnBlur(e)}
|
||||
onFocus={(e: NativeSyntheticEvent<TextInputFocusEventData>) => this.handleOnFocus(e)}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class StatusBarTest extends React.Component {
|
||||
render() {
|
||||
StatusBar.setBarStyle("dark-content", true);
|
||||
|
||||
5
types/restify-errors/index.d.ts
vendored
5
types/restify-errors/index.d.ts
vendored
@@ -130,6 +130,11 @@ export class InsufficientStorageError extends DefinedHttpError { }
|
||||
export class BandwidthLimitExceededError extends DefinedHttpError { }
|
||||
export class NotExtendedError extends DefinedHttpError { }
|
||||
export class NetworkAuthenticationRequiredError extends DefinedHttpError { }
|
||||
export class PayloadTooLargeError extends DefinedHttpError { }
|
||||
export class UriTooLongError extends DefinedHttpError { }
|
||||
export class MisdirectedRequestError extends DefinedHttpError { }
|
||||
export class UnavailableForLegalReasonsError extends DefinedHttpError { }
|
||||
export class LoopDetectedError extends DefinedHttpError { }
|
||||
|
||||
export class BadDigestError extends DefinedRestError { }
|
||||
export class BadMethodError extends DefinedRestError { }
|
||||
|
||||
@@ -62,6 +62,12 @@ httpError = new restifyErrors.InsufficientStorageError();
|
||||
httpError = new restifyErrors.BandwidthLimitExceededError();
|
||||
httpError = new restifyErrors.NotExtendedError();
|
||||
httpError = new restifyErrors.NetworkAuthenticationRequiredError();
|
||||
httpError = new restifyErrors.PayloadTooLargeError();
|
||||
httpError = new restifyErrors.UriTooLongError();
|
||||
httpError = new restifyErrors.MisdirectedRequestError();
|
||||
httpError = new restifyErrors.UnavailableForLegalReasonsError();
|
||||
httpError = new restifyErrors.LoopDetectedError();
|
||||
httpError = new restifyErrors.NetworkAuthenticationRequiredError();
|
||||
|
||||
// RestErrors
|
||||
let restError = new restifyErrors.BadDigestError();
|
||||
|
||||
Reference in New Issue
Block a user