mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge remote-tracking branch 'first/master' into node4_buffer_alloc
This commit is contained in:
@@ -570,6 +570,12 @@
|
||||
"sourceRepoURL": "https://github.com/gpbl/react-day-picker",
|
||||
"asOfVersion": "5.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-native-elements",
|
||||
"typingsPackageName": "react-native-elements",
|
||||
"sourceRepoURL": "https://github.com/react-native-training/react-native-elements",
|
||||
"asOfVersion": "0.18.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "realm",
|
||||
"typingsPackageName": "realm",
|
||||
|
||||
@@ -121,12 +121,12 @@ let _algoliaQueryParameters: AlgoliaQueryParameters = {
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: '',
|
||||
aroundRadius: 0,
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: '',
|
||||
insideBoundingBox: [[0]],
|
||||
queryType: '',
|
||||
insidePolygon: '',
|
||||
insidePolygon: [[0]],
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
|
||||
Vendored
+3
-3
@@ -1770,7 +1770,7 @@ Interface describing options available for gettings the logs
|
||||
* You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundradius
|
||||
*/
|
||||
aroundRadius?: any;
|
||||
aroundRadius?: number | 'all';
|
||||
/**
|
||||
* Control the precision of a geo search
|
||||
* default: null
|
||||
@@ -1788,7 +1788,7 @@ Interface describing options available for gettings the logs
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#insideboundingbox
|
||||
*/
|
||||
insideBoundingBox?: string;
|
||||
insideBoundingBox?: number[][];
|
||||
/**
|
||||
* Selects how the query words are interpreted
|
||||
* default: 'prefixLast'
|
||||
@@ -1803,7 +1803,7 @@ Interface describing options available for gettings the logs
|
||||
* defauly: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#insidepolygon
|
||||
*/
|
||||
insidePolygon?: string;
|
||||
insidePolygon?: number[][];
|
||||
/**
|
||||
* This option is used to select a strategy in order to avoid having an empty result page
|
||||
* default: 'none'
|
||||
|
||||
Vendored
+13
-13
@@ -26,20 +26,20 @@ declare namespace Chai {
|
||||
version: string;
|
||||
}
|
||||
|
||||
interface ExpectStatic extends AssertionStatic {
|
||||
export interface ExpectStatic extends AssertionStatic {
|
||||
fail(actual?: any, expected?: any, message?: string, operator?: Operator): void;
|
||||
}
|
||||
|
||||
interface AssertStatic extends Assert {
|
||||
export interface AssertStatic extends Assert {
|
||||
}
|
||||
|
||||
interface AssertionStatic {
|
||||
export interface AssertionStatic {
|
||||
(target: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!==";
|
||||
export type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!==";
|
||||
|
||||
type OperatorComparable = boolean | null | number | string | undefined | Date;
|
||||
export type OperatorComparable = boolean | null | number | string | undefined | Date;
|
||||
|
||||
interface ShouldAssertion {
|
||||
equal(value1: any, value2: any, message?: string): void;
|
||||
@@ -256,7 +256,7 @@ declare namespace Chai {
|
||||
(object: Object, property: string, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Assert {
|
||||
export interface Assert {
|
||||
/**
|
||||
* @param expression Expression to test for truthiness.
|
||||
* @param message Message to display on error.
|
||||
@@ -1587,7 +1587,7 @@ declare namespace Chai {
|
||||
doesNotHaveAllDeepKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
export interface Config {
|
||||
/**
|
||||
* Default: false
|
||||
*/
|
||||
@@ -1604,7 +1604,7 @@ declare namespace Chai {
|
||||
truncateThreshold: number;
|
||||
}
|
||||
|
||||
class AssertionError {
|
||||
export class AssertionError {
|
||||
constructor(message: string, _props?: any, ssf?: Function);
|
||||
name: string;
|
||||
message: string;
|
||||
@@ -1615,10 +1615,10 @@ declare namespace Chai {
|
||||
|
||||
declare const chai: Chai.ChaiStatic;
|
||||
|
||||
export = chai;
|
||||
declare module "chai" {
|
||||
export = chai;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Object {
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
interface Object {
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"new-parens": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-empty-interface": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-unnecessary-generics": false
|
||||
"no-single-declare-module": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for chokidar 1.7.1
|
||||
// Type definitions for chokidar 1.7
|
||||
// Project: https://github.com/paulmillr/chokidar
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners>
|
||||
// Felix Becker <https://github.com/felixfbecker>
|
||||
@@ -19,7 +19,6 @@ export interface WatchedPaths {
|
||||
}
|
||||
|
||||
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
|
||||
/**
|
||||
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
|
||||
*/
|
||||
@@ -52,7 +51,6 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
}
|
||||
|
||||
export interface WatchOptions {
|
||||
|
||||
/**
|
||||
* Indicates whether the process should continue to run as long as files are being watched. If
|
||||
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
|
||||
@@ -86,7 +84,7 @@ export interface WatchOptions {
|
||||
* be relative to this.
|
||||
*/
|
||||
cwd?: string;
|
||||
|
||||
|
||||
/**
|
||||
* If set to true then the strings passed to .watch() and .add() are treated as literal path
|
||||
* names, even if they look like globs. Default: false.
|
||||
@@ -155,7 +153,6 @@ export interface WatchOptions {
|
||||
}
|
||||
|
||||
export interface AwaitWriteFinishOptions {
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
|
||||
*/
|
||||
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Vendored
+3
-3
@@ -746,7 +746,7 @@ declare namespace Draft {
|
||||
}
|
||||
|
||||
class ContentState extends Record {
|
||||
static createFromBlockArray(blocks: Array<ContentBlock>, entityMap: any): ContentState;
|
||||
static createFromBlockArray(blocks: Array<ContentBlock>, entityMap?: any): ContentState;
|
||||
static createFromText(text: string, delimiter?: string): ContentState;
|
||||
|
||||
createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState;
|
||||
@@ -797,7 +797,7 @@ declare namespace Draft {
|
||||
class CharacterMetadata {
|
||||
static applyStyle(record: CharacterMetadata, style: string): CharacterMetadata;
|
||||
static removeStyle(record: CharacterMetadata, style: string): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata, entityKey: string): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata, entityKey: string | null): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata): CharacterMetadata;
|
||||
/**
|
||||
* Use this function instead of the `CharacterMetadata` constructor.
|
||||
@@ -894,7 +894,7 @@ declare namespace Draft {
|
||||
|
||||
static setBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map<any, any>): ContentState;
|
||||
static mergeBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map<any, any>): ContentState;
|
||||
static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string): ContentState;
|
||||
static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string | null): ContentState;
|
||||
}
|
||||
|
||||
class RichTextEditorUtil {
|
||||
|
||||
Vendored
+2
@@ -137,6 +137,7 @@ export interface ShardsResponse {
|
||||
total: number;
|
||||
successful: number;
|
||||
failed: number;
|
||||
skipped: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -638,6 +639,7 @@ export interface SearchResponse<T> {
|
||||
fields?: any;
|
||||
highlight?: any;
|
||||
inner_hits?: any;
|
||||
sort?: string[];
|
||||
}>;
|
||||
};
|
||||
aggregations?: any;
|
||||
|
||||
Vendored
+1
-1
@@ -995,7 +995,7 @@ declare global {
|
||||
/**
|
||||
* Immediately switches to a different view.
|
||||
*/
|
||||
fullCalendar(method: 'changeView', viewName: string): void;
|
||||
fullCalendar(method: 'changeView', viewName: string, dateOrRange?: moment.Moment | Date | string | TimeRange): void;
|
||||
|
||||
/**
|
||||
* Moves the calendar one step back (either by a month, week, or day).
|
||||
|
||||
@@ -22,21 +22,22 @@ const users: {[index: string]: User} = {
|
||||
}
|
||||
};
|
||||
|
||||
const validate: Basic.ValidateFunc = function (request, username, password, callback) {
|
||||
const validate: Basic.Validate = async (request, username, password, h) => {
|
||||
|
||||
const user = users[username];
|
||||
if (!user) {
|
||||
return callback(null, false);
|
||||
return { isValid: false, credentials: null };
|
||||
}
|
||||
|
||||
Bcrypt.compare(password, user.password, (err, isValid) => {
|
||||
let isValid = await Bcrypt.compare(password, user.password)
|
||||
|
||||
callback(err, isValid, { id: user.id, name: user.name });
|
||||
});
|
||||
return { isValid, credentials: { id: user.id, name: user.name } };
|
||||
};
|
||||
|
||||
server.register(Basic, (err) => {
|
||||
server.register(Basic).then(() => {
|
||||
|
||||
server.auth.strategy('simple', 'basic', { validate });
|
||||
server.auth.default('simple');
|
||||
|
||||
server.auth.strategy('simple', 'basic', { validateFunc: validate });
|
||||
server.route({ method: 'GET', path: '/', config: { auth: 'simple' } });
|
||||
});
|
||||
|
||||
Vendored
+11
-5
@@ -1,18 +1,24 @@
|
||||
// Type definitions for hapi 4.2
|
||||
// Type definitions for hapi-bauth-basic 5.0.0
|
||||
// Project: https://github.com/hapijs/hapi-auth-basic
|
||||
// Definitions by: AJP <https://github.com/AJamesPhillips>
|
||||
// Rodrigo Saboya <https://github.com/saboya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import * as Hapi from 'hapi';
|
||||
|
||||
declare namespace Basic {
|
||||
interface ValidateFuncCallback {
|
||||
(err: Error | null, isValid: boolean, userCredentials?: any): void;
|
||||
interface ValidateCustomResponse {
|
||||
response: any,
|
||||
}
|
||||
|
||||
interface ValidateFunc {
|
||||
(request: Hapi.Request, username: string, password: string, callback: ValidateFuncCallback): void;
|
||||
interface ValidateResponse {
|
||||
isValid: boolean,
|
||||
credentials?: any,
|
||||
}
|
||||
|
||||
interface Validate {
|
||||
(request: Hapi.Request, username: string, password: string, h: object): Promise<ValidateResponse | ValidateCustomResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-10
@@ -195,8 +195,8 @@ declare namespace IORedis {
|
||||
|
||||
zrem(key: string, member: string, ...members: any[]): any;
|
||||
|
||||
zremrangebyscore(key: string, min: number, max: number, callback: (err: Error, res: any) => void): void;
|
||||
zremrangebyscore(key: string, min: number, max: number): Promise<any>;
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void;
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string): Promise<any>;
|
||||
|
||||
zremrangebyrank(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
zremrangebyrank(key: string, start: number, stop: number): Promise<any>;
|
||||
@@ -213,12 +213,12 @@ declare namespace IORedis {
|
||||
zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void;
|
||||
zrevrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise<any>;
|
||||
|
||||
zrangebyscore(key: string, min: number, max: number, ...args: string[]): any;
|
||||
zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): any;
|
||||
|
||||
zrevrangebyscore(key: string, max: number, min: number, ...args: string[]): any;
|
||||
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): any;
|
||||
|
||||
zcount(key: string, min: number, max: number, callback: (err: Error, res: number) => void): void;
|
||||
zcount(key: string, min: number, max: number): Promise<number>;
|
||||
zcount(key: string, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void;
|
||||
zcount(key: string, min: number | string, max: number | string): Promise<number>;
|
||||
|
||||
zcard(key: string, callback: (err: Error, res: number) => void): void;
|
||||
zcard(key: string): Promise<number>;
|
||||
@@ -554,7 +554,7 @@ declare namespace IORedis {
|
||||
|
||||
zrem(key: string, member: string, ...members: any[]): Pipeline;
|
||||
|
||||
zremrangebyscore(key: string, min: number, max: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zremrangebyrank(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
@@ -568,11 +568,11 @@ declare namespace IORedis {
|
||||
zrevrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zrangebyscore(key: string, min: number, max: number, ...args: string[]): Pipeline;
|
||||
zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): Pipeline;
|
||||
|
||||
zrevrangebyscore(key: string, max: number, min: number, ...args: string[]): Pipeline;
|
||||
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): Pipeline;
|
||||
|
||||
zcount(key: string, min: number, max: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
zcount(key: string, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
zcard(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
|
||||
Vendored
+9
-8
@@ -1,6 +1,7 @@
|
||||
// Type definitions for nes 6.4.2
|
||||
// Type definitions for nes 7.0.0
|
||||
// Project: https://github.com/hapijs/nes
|
||||
// Definitions by: Ivo Stratev <https://github.com/NoHomey>
|
||||
// Rodrigo Saboya <https://github.com/saboya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Client {
|
||||
@@ -9,14 +10,14 @@ declare class Client {
|
||||
onConnect: () => void;
|
||||
onDisconnect: () => void;
|
||||
onUpdate: (message: any) => void;
|
||||
connect(options: Client.ClientConnectOptions, callback: (err?: any) => void): void;
|
||||
connect(callback: (err?: any) => void): void;
|
||||
disconnect(): void;
|
||||
connect(options: Client.ClientConnectOptions): Promise<any>;
|
||||
connect(): Promise<any>;
|
||||
disconnect(): Promise<any>;
|
||||
id: any; // can be `null | number` but also the "socket" value from websocket message data.
|
||||
request(options: string | Client.ClientRequestOptions, callback: (err: any, payload: any, statusCode?: number, headers?: Object) => void): void;
|
||||
message(message: any, callback: (err: any, message: any) => void): void;
|
||||
subscribe(path: string, handler: Client.Handler, callback: (err?: any) => void): void;
|
||||
unsubscribe(path: string, handler: Client.Handler, callback: (err?: any) => void): void;
|
||||
request(options: string | Client.ClientRequestOptions): Promise<any>;
|
||||
message(message: any): Promise<any>;
|
||||
subscribe(path: string, handler: Client.Handler): Promise<any>;
|
||||
unsubscribe(path: string, handler: Client.Handler): Promise<any>;
|
||||
subscriptions(): string[];
|
||||
overrideReconnectionAuth(auth: any): void;
|
||||
}
|
||||
|
||||
Vendored
+10
-9
@@ -1,6 +1,7 @@
|
||||
// Type definitions for nes 6.2.1
|
||||
// Type definitions for nes 7.0.0
|
||||
// Project: https://github.com/hapijs/nes
|
||||
// Definitions by: Ivo Stratev <https://github.com/NoHomey>
|
||||
// Rodrigo Saboya <https://github.com/saboya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -62,12 +63,12 @@ declare module nes {
|
||||
index?: boolean;
|
||||
}
|
||||
|
||||
export type ServerOnSubscribeWithParams = (socket: Socket, path: string, params: any, next: (err?: any) => void) => void;
|
||||
export type ServerOnSubscribeWithoutParams = (socket: Socket, path: string, next: (err?: any) => void) => void;
|
||||
export type ServerOnSubscribeWithParams = (socket: Socket, path: string, params: any) => Promise<any>;
|
||||
export type ServerOnSubscribeWithoutParams = (socket: Socket, path: string) => Promise<any>;
|
||||
export type ServerOnSubscribe = ServerOnSubscribeWithParams | ServerOnSubscribeWithoutParams;
|
||||
|
||||
export type ServerOnUnSubscribeWithParams = (socket: Socket, path: string, params: any, next: () => void) => void;
|
||||
export type ServerOnUnSubscribeWithoutParams = (socket: Socket, path: string, next: () => void) => void;
|
||||
export type ServerOnUnSubscribeWithParams = (socket: Socket, path: string, params: any) => void;
|
||||
export type ServerOnUnSubscribeWithoutParams = (socket: Socket, path: string) => void;
|
||||
export type ServerOnUnSubscribe = ServerOnUnSubscribeWithParams | ServerOnUnSubscribeWithoutParams;
|
||||
|
||||
interface ServerSubscriptionOptions {
|
||||
@@ -91,10 +92,10 @@ declare module nes {
|
||||
id: string;
|
||||
app: Object;
|
||||
auth: nes.SocketAuthObject;
|
||||
disconnect(callback?: () => void): void;
|
||||
send(message: any, callback?: (err?: any) => void): void;
|
||||
publish(path: string, message: any, callback?: (err?: any) => void): void;
|
||||
revoke(path: string, message: any, callback?: (err?: any) => void): void;
|
||||
disconnect(): Promise<any>;
|
||||
send(message: any): Promise<any>;
|
||||
publish(path: string, message: any): Promise<any>;
|
||||
revoke(path: string, message: any): Promise<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import Nes = require('nes');
|
||||
|
||||
var client = new Nes.Client('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {
|
||||
|
||||
client.onUpdate = function (update) {
|
||||
|
||||
@@ -16,7 +16,7 @@ client.connect(function (err) {
|
||||
import NesClient = require('nes/client');
|
||||
|
||||
var client = new NesClient('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {
|
||||
|
||||
client.onUpdate = function (update) {
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@ import Hapi = require('hapi');
|
||||
import Nes = require('nes');
|
||||
|
||||
var server = new Hapi.Server();
|
||||
server.connection();
|
||||
|
||||
server.register(Nes, function (err) {
|
||||
server.register(Nes).then(() => {
|
||||
|
||||
server.start(function (err) {
|
||||
return server.start().then(() => {
|
||||
|
||||
server.broadcast('welcome!');
|
||||
});
|
||||
|
||||
+44
-55
@@ -2,66 +2,55 @@ import Hapi = require('hapi');
|
||||
import Nes = require('nes');
|
||||
|
||||
var server: Hapi.Server = new Hapi.Server();
|
||||
server.connection({port: 8080});
|
||||
|
||||
server.register(Nes, (regErr) => {
|
||||
if(regErr) {
|
||||
console.log('register err');
|
||||
console.log(regErr);
|
||||
} else {
|
||||
// No longer need to cast to Nes.Server as Hapi.Server has been modified directly.
|
||||
// let wsServer: Nes.Server = server as Nes.Server;
|
||||
let wsServer: Hapi.Server = server;
|
||||
wsServer.subscription('/item/{id}');
|
||||
wsServer.route( {
|
||||
method: 'GET',
|
||||
path: '/test',
|
||||
config: {
|
||||
handler: (request, reply) => {
|
||||
reply({test: 'passes ' + request.socket.id});
|
||||
}
|
||||
server.register(Nes).then(() => {
|
||||
// No longer need to cast to Nes.Server as Hapi.Server has been modified directly.
|
||||
// let wsServer: Nes.Server = server as Nes.Server;
|
||||
let wsServer: Hapi.Server = server;
|
||||
wsServer.subscription('/item/{id}');
|
||||
wsServer.route( {
|
||||
method: 'GET',
|
||||
path: '/test',
|
||||
config: {
|
||||
handler: (request, h) => {
|
||||
return {test: 'passes ' + request.socket.id};
|
||||
}
|
||||
});
|
||||
wsServer.start((err: any) => {
|
||||
if(err) {
|
||||
console.log('start err');
|
||||
console.log(err);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
wsServer.publish('/item/5', { id: 5, status: 'complete' });
|
||||
wsServer.publish('/item/6', { id: 6, status: 'initial' });
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
wsServer.start().then(() => {
|
||||
setTimeout(() => {
|
||||
wsServer.publish('/item/5', { id: 5, status: 'complete' });
|
||||
wsServer.publish('/item/6', { id: 6, status: 'initial' });
|
||||
}, 100);
|
||||
}).catch((err) => {
|
||||
console.log('start err');
|
||||
console.log(err);
|
||||
});
|
||||
}).catch((regErr: any) => {
|
||||
console.log('register err');
|
||||
console.log(regErr);
|
||||
});
|
||||
|
||||
let options: Nes.ClientConnectOptions = {delay: 3};
|
||||
|
||||
let wsClient: Nes.Client = new Nes.Client('ws://localhost:8080', options);
|
||||
wsClient.connect((err: any) => {
|
||||
if(err) {
|
||||
console.log('start err');
|
||||
console.log(err);
|
||||
} else {
|
||||
wsClient.subscribe('/item/5', (update) => {
|
||||
wsClient.request('/test', (reqErr, payload, statusCode) => {
|
||||
if(reqErr) {
|
||||
console.log('request err');
|
||||
console.log(reqErr);
|
||||
} else {
|
||||
console.log(update);
|
||||
console.log(payload);
|
||||
if(payload.test === 'passes') {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
})
|
||||
}, (subErr) => {
|
||||
if(subErr) {
|
||||
console.log('subscribe err');
|
||||
console.log(subErr);
|
||||
let wsClient: Nes.Client = new Nes.Client('ws://localhost', options);
|
||||
wsClient.connect().then(() => {
|
||||
wsClient.subscribe('/item/5', (update) => {
|
||||
wsClient.request('/test').then(({ payload, statusCode }) => {
|
||||
console.log(update);
|
||||
console.log(payload);
|
||||
if(payload.test === 'passes') {
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch((reqErr: any) => {
|
||||
console.log('request err');
|
||||
console.log(reqErr);
|
||||
})
|
||||
}).catch((subErr: any) => {
|
||||
console.log('subscribe err');
|
||||
console.log(subErr);
|
||||
});
|
||||
}).catch((err: any) => {
|
||||
console.log('start err');
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
import Nes = require('nes');
|
||||
|
||||
var client = new Nes.Client('ws://localhost');
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }, function (err) {
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }).then(() => {
|
||||
|
||||
client.request('hello', function (err, payload) { // Can also request '/h'
|
||||
|
||||
// payload -> 'Hello John Doe'
|
||||
});
|
||||
client.request('hello');
|
||||
});
|
||||
|
||||
// Added in addition to nes doc example code
|
||||
@@ -16,10 +13,7 @@ client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } }
|
||||
import NesClient = require('nes/client');
|
||||
|
||||
var client = new NesClient('ws://localhost');
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }, function (err) {
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }).then(() => {
|
||||
|
||||
client.request('hello', function (err, payload) { // Can also request '/h'
|
||||
|
||||
// payload -> 'Hello John Doe'
|
||||
});
|
||||
return client.request('hello');
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import Nes = require('nes');
|
||||
var server = new Hapi.Server();
|
||||
server.connection();
|
||||
|
||||
server.register([Basic, Nes], function (err) {
|
||||
server.register([Basic, Nes]).then(() => {
|
||||
|
||||
// Set up HTTP Basic authentication
|
||||
|
||||
@@ -28,20 +28,20 @@ server.register([Basic, Nes], function (err) {
|
||||
}
|
||||
};
|
||||
|
||||
var validate: Basic.ValidateFunc = function (request, username, password, callback) {
|
||||
var validate: Basic.Validate = async (request, username, password, h) => {
|
||||
|
||||
var user = users[username];
|
||||
if (!user) {
|
||||
return callback(null, false);
|
||||
return { credentials: null, isValid: false };
|
||||
}
|
||||
|
||||
Bcrypt.compare(password, user.password, function (err, isValid) {
|
||||
let isValid = await Bcrypt.compare(password, user.password)
|
||||
|
||||
callback(err, isValid, { id: user.id, name: user.name });
|
||||
});
|
||||
return { isValid, credentials: { id: user.id, name: user.name } };
|
||||
};
|
||||
|
||||
server.auth.strategy('simple', 'basic', 'required', { validateFunc: validate });
|
||||
server.auth.strategy('simple', 'basic', { validateFunc: validate });
|
||||
server.auth.default('simple');
|
||||
|
||||
// Configure route with authentication
|
||||
|
||||
@@ -50,12 +50,12 @@ server.register([Basic, Nes], function (err) {
|
||||
path: '/h',
|
||||
config: {
|
||||
id: 'hello',
|
||||
handler: function (request, reply) {
|
||||
handler: function (request, h) {
|
||||
|
||||
return reply('Hello ' + request.auth.credentials.name);
|
||||
return 'Hello ' + request.auth.credentials.name;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
server.start(function (err) { /* ... */ });
|
||||
return server.start();
|
||||
});
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
import Nes = require('nes');
|
||||
|
||||
var client = new Nes.Client('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {
|
||||
|
||||
client.request('hello', function (err, payload) { // Can also request '/h'
|
||||
|
||||
// payload -> 'world!'
|
||||
});
|
||||
return client.request('hello');
|
||||
});
|
||||
|
||||
// Added in addition to nes doc example code
|
||||
@@ -16,10 +13,7 @@ client.connect(function (err) {
|
||||
import NesClient = require('nes/client');
|
||||
|
||||
var client = new NesClient('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {
|
||||
|
||||
client.request('hello', function (err, payload) { // Can also request '/h'
|
||||
|
||||
// payload -> 'world!'
|
||||
});
|
||||
return client.request('hello');
|
||||
});
|
||||
|
||||
@@ -4,21 +4,20 @@ import Hapi = require('hapi');
|
||||
import Nes = require('nes');
|
||||
|
||||
var server = new Hapi.Server();
|
||||
server.connection();
|
||||
|
||||
server.register(Nes, function (err) {
|
||||
server.register(Nes).then(() => {
|
||||
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/h',
|
||||
config: {
|
||||
id: 'hello',
|
||||
handler: function (request, reply) {
|
||||
handler: (request, h) => {
|
||||
|
||||
return reply('world!');
|
||||
return 'world!';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
server.start(function (err) { /* ... */ });
|
||||
return server.start();
|
||||
});
|
||||
|
||||
@@ -4,13 +4,11 @@ import Nes = require('nes');
|
||||
|
||||
const socket: Nes.Socket = undefined;
|
||||
|
||||
const cb = () => { };
|
||||
socket.disconnect(cb);
|
||||
socket.disconnect();
|
||||
const s: string = socket.id;
|
||||
const o: Object = socket.app;
|
||||
const auth: Nes.SocketAuthObject = socket.auth;
|
||||
|
||||
const cb2 = (err?: any) => { };
|
||||
socket.send('message', (err?: any) => { });
|
||||
socket.publish('path', 'message', cb2);
|
||||
socket.revoke('path', 'message', cb2);
|
||||
socket.send('message');
|
||||
socket.publish('path', 'message');
|
||||
socket.revoke('path', 'message');
|
||||
|
||||
@@ -6,15 +6,15 @@ var client = new Nes.Client('ws://localhost');
|
||||
|
||||
// Authenticate as 'john'
|
||||
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }, function (err) {
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }).then(() => {
|
||||
|
||||
var handler: Nes.Handler = function (err, update) {
|
||||
var handler: Nes.Handler = (update) => {
|
||||
|
||||
// First publish is not received (filtered due to updater key)
|
||||
// update -> { id: 6, status: 'initial', updater: 'steve' }
|
||||
};
|
||||
|
||||
client.subscribe('/items', handler, function (err) { });
|
||||
return client.subscribe('/items', handler);
|
||||
});
|
||||
|
||||
// Added in addition to nes doc example code
|
||||
@@ -25,13 +25,13 @@ var client = new NesClient('ws://localhost');
|
||||
|
||||
// Authenticate as 'john'
|
||||
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }, function (err) {
|
||||
client.connect({ auth: { headers: { authorization: 'Basic am9objpzZWNyZXQ=' } } }).then(() => {
|
||||
|
||||
var handler: NesClient.Handler = function (err, update) {
|
||||
var handler: NesClient.Handler = (update) => {
|
||||
|
||||
// First publish is not received (filtered due to updater key)
|
||||
// update -> { id: 6, status: 'initial', updater: 'steve' }
|
||||
};
|
||||
|
||||
client.subscribe('/items', handler, function (err) { });
|
||||
return client.subscribe('/items', handler);
|
||||
});
|
||||
|
||||
@@ -6,9 +6,8 @@ import Bcrypt = require('bcrypt');
|
||||
import Nes = require('nes');
|
||||
|
||||
var server = new Hapi.Server();
|
||||
server.connection();
|
||||
|
||||
server.register([Basic, Nes], function (err) {
|
||||
server.register([Basic, Nes]).then(() => {
|
||||
|
||||
// Set up HTTP Basic authentication
|
||||
|
||||
@@ -28,31 +27,31 @@ server.register([Basic, Nes], function (err) {
|
||||
}
|
||||
};
|
||||
|
||||
var validate: Basic.ValidateFunc = function (request, username, password, callback) {
|
||||
var validate: Basic.Validate = async (request, username, password, h) => {
|
||||
|
||||
var user = users[username];
|
||||
if (!user) {
|
||||
return callback(null, false);
|
||||
return { credentials: null, isValid: false };
|
||||
}
|
||||
|
||||
Bcrypt.compare(password, user.password, function (err, isValid) {
|
||||
let isValid = await Bcrypt.compare(password, user.password)
|
||||
|
||||
callback(err, isValid, { id: user.id, name: user.name, username: user.username });
|
||||
});
|
||||
return { isValid, credentials: { id: user.id, name: user.name, username: user.username } };
|
||||
};
|
||||
|
||||
server.auth.strategy('simple', 'basic', 'required', { validateFunc: validate });
|
||||
server.auth.strategy('simple', 'basic', { validate });
|
||||
server.auth.default('simple')
|
||||
|
||||
// Set up subscription
|
||||
|
||||
server.subscription('/items', {
|
||||
filter: function (path, message, options, next) {
|
||||
filter: (path, message, options) => {
|
||||
|
||||
return next(message.updater !== options.credentials.username);
|
||||
return message.updater !== options.credentials.username;
|
||||
}
|
||||
});
|
||||
|
||||
server.start(function (err) {
|
||||
server.start().then(() => {
|
||||
|
||||
server.publish('/items', { id: 5, status: 'complete', updater: 'john' });
|
||||
server.publish('/items', { id: 6, status: 'initial', updater: 'steve' });
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
import Nes = require('nes');
|
||||
|
||||
var client = new Nes.Client('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {;
|
||||
|
||||
var handler: Nes.Handler = function (update, flags) {
|
||||
var handler: Nes.Handler = (update, flags) => {
|
||||
|
||||
// update -> { id: 5, status: 'complete' }
|
||||
// Second publish is not received (doesn't match)
|
||||
};
|
||||
|
||||
client.subscribe('/item/5', handler, function (err) { });
|
||||
return client.subscribe('/item/5', handler);
|
||||
});
|
||||
|
||||
// Added in addition to nes doc example code
|
||||
@@ -19,13 +19,13 @@ client.connect(function (err) {
|
||||
import NesClient = require('nes/client');
|
||||
|
||||
var client = new NesClient('ws://localhost');
|
||||
client.connect(function (err) {
|
||||
client.connect().then(() => {
|
||||
|
||||
var handler: NesClient.Handler = function (update, flags) {
|
||||
var handler: NesClient.Handler = (update, flags) => {
|
||||
|
||||
// update -> { id: 5, status: 'complete' }
|
||||
// Second publish is not received (doesn't match)
|
||||
};
|
||||
|
||||
client.subscribe('/item/5', handler, function (err) { });
|
||||
return client.subscribe('/item/5', handler);
|
||||
});
|
||||
|
||||
@@ -4,15 +4,14 @@ import Hapi = require('hapi');
|
||||
import Nes = require('nes');
|
||||
|
||||
var server = new Hapi.Server();
|
||||
server.connection();
|
||||
|
||||
server.register(Nes, function (err) {
|
||||
server.register(Nes).then(() =>{;
|
||||
|
||||
server.subscription('/item/{id}');
|
||||
|
||||
server.start(function (err) {
|
||||
return server.start().then(() => {
|
||||
|
||||
server.publish('/item/5', { id: 5, status: 'complete' });
|
||||
server.publish('/item/6', { id: 6, status: 'initial' });
|
||||
server.publish('/item/5', {id: 5, status: 'complete'});
|
||||
server.publish('/item/6', {id: 6, status: 'initial'});
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
Vendored
+1
-1
@@ -122,7 +122,7 @@ declare namespace NodeRSA {
|
||||
|
||||
type Encoding =
|
||||
| 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1'
|
||||
| 'base64' | 'hex' | 'binary';
|
||||
| 'base64' | 'hex' | 'binary' | 'buffer';
|
||||
|
||||
interface KeyComponents {
|
||||
n: Buffer;
|
||||
|
||||
Vendored
+11
-2
@@ -15,6 +15,7 @@
|
||||
// Alvis HT Tang <https://github.com/alvis>
|
||||
// Oliver Joseph Ash <https://github.com/OliverJAsh>
|
||||
// Sebastian Silbermann <https://github.com/eps1lon>
|
||||
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -105,7 +106,7 @@ declare function clearImmediate(immediateId: any): void;
|
||||
|
||||
// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
|
||||
interface NodeRequireFunction {
|
||||
/* tslint:disable-next-line:callable-types */
|
||||
/* tslint:disable-next-line:callable-types */
|
||||
(id: string): any;
|
||||
}
|
||||
|
||||
@@ -4881,7 +4882,7 @@ declare module "tls" {
|
||||
servername?: string;
|
||||
path?: string;
|
||||
ALPNProtocols?: Array<string | Buffer>;
|
||||
checkServerIdentity?: (servername: string, cert: string | Buffer | Array<string | Buffer>) => any;
|
||||
checkServerIdentity?: typeof checkServerIdentity;
|
||||
secureProtocol?: string;
|
||||
secureContext?: Object;
|
||||
session?: Buffer;
|
||||
@@ -4984,6 +4985,14 @@ declare module "tls" {
|
||||
context: any;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verifies the certificate `cert` is issued to host `host`.
|
||||
* @host The hostname to verify the certificate against
|
||||
* @cert PeerCertificate representing the peer's certificate
|
||||
*
|
||||
* Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined.
|
||||
*/
|
||||
export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
|
||||
export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
|
||||
export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket;
|
||||
export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
||||
|
||||
Vendored
+6
@@ -2,8 +2,11 @@
|
||||
// Project: https://github.com/quilljs/quill/
|
||||
// Definitions by: Sumit <https://github.com/sumitkm>
|
||||
// Guillaume <https://github.com/guillaume-ro-fr>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Blot } from 'parchment/src/blot/abstract/blot';
|
||||
|
||||
/**
|
||||
* A stricter type definition would be:
|
||||
*
|
||||
@@ -56,7 +59,9 @@ export interface QuillOptionsStatic {
|
||||
}
|
||||
|
||||
export interface BoundsStatic {
|
||||
bottom: number;
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
height: number;
|
||||
width: number;
|
||||
@@ -136,6 +141,7 @@ export class Quill implements EventEmitter {
|
||||
*/
|
||||
root: HTMLDivElement;
|
||||
clipboard: ClipboardStatic;
|
||||
scroll: Blot;
|
||||
constructor(container: string | Element, options?: QuillOptionsStatic);
|
||||
deleteText(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
disable(): void;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"parchment": "^1.1.2"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Quill, Delta, DeltaStatic, RangeStatic, StringMap } from 'quill';
|
||||
import { Blot } from 'parchment/src/blot/abstract/blot';
|
||||
|
||||
function test_quill() {
|
||||
const quillEditor = new Quill('#editor', {
|
||||
@@ -10,6 +11,11 @@ function test_quill() {
|
||||
});
|
||||
}
|
||||
|
||||
function test_scroll() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
const blot: Blot = quillEditor.scroll;
|
||||
}
|
||||
|
||||
function test_deleteText() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
quillEditor.deleteText(0, 10);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# react-autosuggest usage notes
|
||||
|
||||
The definition uses generics for stronger typing. Read the [TypeScript deep dive on JSX Generic components](https://basarat.gitbooks.io/typescript/docs/jsx/tsx.html#react-jsx-tip-generic-components) for details on consuming these type definitions.
|
||||
|
||||
## Example
|
||||
|
||||
```jsx
|
||||
import * as Autosuggest from 'react-autosuggest'
|
||||
interface Language {
|
||||
name: string
|
||||
year: number
|
||||
}
|
||||
|
||||
const LanguageAutosuggest = Autosuggest as { new (): Autosuggest<Language> }
|
||||
|
||||
<LanguageAutosuggest
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested.bind(this)}
|
||||
getSuggestionValue={this.getSuggestionValue}
|
||||
renderSuggestion={this.renderSuggestion}
|
||||
onSuggestionSelected={this.onSuggestionsSelected}
|
||||
alwaysRenderSuggestions={true}
|
||||
inputProps={inputProps}
|
||||
theme={theme}
|
||||
/>
|
||||
```
|
||||
|
||||
Find multiple full examples in `react-autosuggest-tests.tsx`
|
||||
Vendored
+177
-61
@@ -5,84 +5,200 @@
|
||||
// Robert Essig <https://github.com/robessog>
|
||||
// Terry Bayne <https://github.com/tbayne>
|
||||
// Christopher Deutsch <https://github.com/cdeutsch>
|
||||
// Kevin Ross <https://github.com/rosskevin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
declare class Autosuggest extends React.Component<Autosuggest.AutosuggestProps> {}
|
||||
declare class Autosuggest<T = any> extends React.Component<Autosuggest.AutosuggestProps<T>> {}
|
||||
|
||||
export = Autosuggest;
|
||||
|
||||
declare namespace Autosuggest {
|
||||
interface SuggestionsFetchRequest {
|
||||
value: string;
|
||||
reason: 'input-changed' | 'input-focused' | 'escape-pressed' | 'suggestions-revealed' | 'suggestion-selected';
|
||||
}
|
||||
/**
|
||||
* Utilies types based on:
|
||||
* https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458
|
||||
*/
|
||||
|
||||
interface InputValues {
|
||||
value: string;
|
||||
valueBeforeUpDown?: string;
|
||||
}
|
||||
/** @internal */
|
||||
type Diff<T extends string, U extends string> = ({ [P in T]: P } &
|
||||
{ [P in U]: never } & { [x: string]: never })[T];
|
||||
|
||||
interface RenderSuggestionParams {
|
||||
query: string;
|
||||
isHighlighted: boolean;
|
||||
}
|
||||
/** @internal */
|
||||
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
||||
|
||||
interface SuggestionHighlightedParams {
|
||||
suggestion: any;
|
||||
}
|
||||
interface SuggestionsFetchRequestedParams {
|
||||
value: string;
|
||||
reason:
|
||||
| 'input-changed'
|
||||
| 'input-focused'
|
||||
| 'escape-pressed'
|
||||
| 'suggestions-revealed'
|
||||
| 'suggestion-selected';
|
||||
}
|
||||
|
||||
interface ChangeEvent {
|
||||
newValue: string;
|
||||
method: 'down' | 'up' | 'escape' | 'enter' | 'click' | 'type';
|
||||
}
|
||||
interface RenderSuggestionParams {
|
||||
query: string;
|
||||
isHighlighted: boolean;
|
||||
}
|
||||
|
||||
interface BlurEvent {
|
||||
highlightedSuggestion: any;
|
||||
}
|
||||
interface SuggestionHighlightedParams {
|
||||
suggestion: any;
|
||||
}
|
||||
|
||||
interface InputProps extends React.InputHTMLAttributes<any> {
|
||||
value: string;
|
||||
onChange(event: React.FormEvent<any>, params?: ChangeEvent): void;
|
||||
onBlur?(event: React.FormEvent<any>, params?: BlurEvent): void;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface ChangeEvent {
|
||||
newValue: string;
|
||||
method: 'down' | 'up' | 'escape' | 'enter' | 'click' | 'type';
|
||||
}
|
||||
|
||||
interface SuggestionSelectedEventData<TSuggestion> {
|
||||
suggestion: TSuggestion;
|
||||
suggestionValue: string;
|
||||
suggestionIndex: number;
|
||||
sectionIndex: number | null;
|
||||
method: 'click' | 'enter';
|
||||
}
|
||||
interface BlurEvent<TSuggestion> {
|
||||
highlightedSuggestion: TSuggestion;
|
||||
}
|
||||
|
||||
type ThemeKey = 'container' | 'containerOpen' | 'input' | 'inputOpen' | 'inputFocused' | 'suggestionsContainer' |
|
||||
'suggestionsContainerOpen' | 'suggestionsList' | 'suggestion' | 'suggestionFirst' | 'suggestionHighlighted' |
|
||||
'sectionContainer' | 'sectionContainerFirst' | 'sectionTitle';
|
||||
interface InputProps<TSuggestion>
|
||||
extends Omit<React.InputHTMLAttributes<any>, 'onChange' | 'onBlur'> {
|
||||
onChange(event: React.FormEvent<any>, params?: ChangeEvent): void;
|
||||
onBlur?(event: React.FormEvent<any>, params?: BlurEvent<TSuggestion>): void;
|
||||
value: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type Theme = Record<string, string | React.CSSProperties> | Partial<Record<ThemeKey, string | React.CSSProperties>>;
|
||||
interface SuggestionSelectedEventData<TSuggestion> {
|
||||
suggestion: TSuggestion;
|
||||
suggestionValue: string;
|
||||
suggestionIndex: number;
|
||||
sectionIndex: number | null;
|
||||
method: 'click' | 'enter';
|
||||
}
|
||||
|
||||
interface AutosuggestProps extends React.Props<Autosuggest> {
|
||||
suggestions: any[];
|
||||
onSuggestionsFetchRequested(request: SuggestionsFetchRequest): void;
|
||||
onSuggestionsClearRequested?(): void;
|
||||
getSuggestionValue(suggestion: any): any;
|
||||
renderSuggestion(suggestion: any, params: RenderSuggestionParams): JSX.Element;
|
||||
inputProps: InputProps;
|
||||
onSuggestionSelected?(event: React.FormEvent<any>, data: SuggestionSelectedEventData<any>): void;
|
||||
onSuggestionHighlighted?(params: SuggestionHighlightedParams): void;
|
||||
shouldRenderSuggestions?(value: string): boolean;
|
||||
alwaysRenderSuggestions?: boolean;
|
||||
highlightFirstSuggestion?: boolean;
|
||||
focusInputOnSuggestionClick?: boolean;
|
||||
multiSection?: boolean;
|
||||
renderSectionTitle?(section: any): JSX.Element;
|
||||
getSectionSuggestions?(section: any): any[];
|
||||
renderInputComponent?(inputProps: InputProps): JSX.Element;
|
||||
renderSuggestionsContainer?(containerProps: any, children: any, query: string): JSX.Element;
|
||||
theme?: Theme;
|
||||
id?: string;
|
||||
}
|
||||
type ThemeKey =
|
||||
| 'container'
|
||||
| 'containerOpen'
|
||||
| 'input'
|
||||
| 'inputOpen'
|
||||
| 'inputFocused'
|
||||
| 'suggestionsContainer'
|
||||
| 'suggestionsContainerOpen'
|
||||
| 'suggestionsList'
|
||||
| 'suggestion'
|
||||
| 'suggestionFirst'
|
||||
| 'suggestionHighlighted'
|
||||
| 'sectionContainer'
|
||||
| 'sectionContainerFirst'
|
||||
| 'sectionTitle';
|
||||
|
||||
type Theme =
|
||||
| Record<string, string | React.CSSProperties>
|
||||
| Partial<Record<ThemeKey, string | React.CSSProperties>>;
|
||||
|
||||
interface RenderSuggestionsContainerParams {
|
||||
containerProps: {
|
||||
id: string;
|
||||
key: string;
|
||||
ref: any;
|
||||
style: any;
|
||||
};
|
||||
children: React.ReactNode;
|
||||
query: string;
|
||||
}
|
||||
|
||||
// types for functions - allowing reuse externally - e.g. as props and bound in the constructor
|
||||
type GetSectionSuggestions<TSuggestion> = (section: any) => TSuggestion[];
|
||||
type GetSuggestionValue<TSuggestion> = (suggestion: TSuggestion) => string;
|
||||
type OnSuggestionHighlighted = (params: SuggestionHighlightedParams) => void;
|
||||
type SuggestionsFetchRequested = (request: SuggestionsFetchRequestedParams) => void;
|
||||
type OnSuggestionsClearRequested = () => void;
|
||||
type OnSuggestionSelected<TSuggestion> = (
|
||||
event: React.FormEvent<any>,
|
||||
data: SuggestionSelectedEventData<TSuggestion>,
|
||||
) => void;
|
||||
type RenderInputComponent<TSuggestion> = (inputProps: InputProps<TSuggestion>) => React.ReactNode;
|
||||
type RenderSuggestionsContainer = (params: RenderSuggestionsContainerParams) => React.ReactNode;
|
||||
type RenderSectionTitle = (section: any) => React.ReactNode;
|
||||
type RenderSuggestion<TSuggestion> = (
|
||||
suggestion: TSuggestion,
|
||||
params: RenderSuggestionParams,
|
||||
) => React.ReactNode;
|
||||
type ShouldRenderSuggestions = (value: string) => boolean;
|
||||
|
||||
interface AutosuggestProps<TSuggestion> {
|
||||
/**
|
||||
* Set it to true if you'd like to render suggestions even when the input is not focused.
|
||||
*/
|
||||
alwaysRenderSuggestions?: boolean;
|
||||
/**
|
||||
* Set it to false if you don't want Autosuggest to keep the input focused when suggestions are clicked/tapped.
|
||||
*/
|
||||
focusInputOnSuggestionClick?: boolean;
|
||||
/**
|
||||
* Implement it to teach Autosuggest where to find the suggestions for every section.
|
||||
*/
|
||||
getSectionSuggestions?: GetSectionSuggestions<TSuggestion>;
|
||||
/**
|
||||
* Implement it to teach Autosuggest what should be the input value when suggestion is clicked.
|
||||
*/
|
||||
getSuggestionValue: GetSuggestionValue<TSuggestion>;
|
||||
/**
|
||||
* Set it to true if you'd like Autosuggest to automatically highlight the first suggestion.
|
||||
*/
|
||||
highlightFirstSuggestion?: boolean;
|
||||
/**
|
||||
* Use it only if you have multiple Autosuggest components on a page.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Pass through arbitrary props to the input. It must contain at least value and onChange.
|
||||
*/
|
||||
inputProps: InputProps<TSuggestion>;
|
||||
/**
|
||||
* Set it to true if you'd like to display suggestions in multiple sections (with optional titles).
|
||||
*/
|
||||
multiSection?: boolean;
|
||||
/**
|
||||
* Will be called every time the highlighted suggestion changes.
|
||||
*/
|
||||
onSuggestionHighlighted?: OnSuggestionHighlighted;
|
||||
/**
|
||||
* Will be called every time you need to recalculate suggestions.
|
||||
*/
|
||||
onSuggestionsFetchRequested: SuggestionsFetchRequested;
|
||||
/**
|
||||
* Will be called every time you need to set suggestions to [].
|
||||
*/
|
||||
onSuggestionsClearRequested?: OnSuggestionsClearRequested;
|
||||
/**
|
||||
* Will be called every time suggestion is selected via mouse or keyboard.
|
||||
*/
|
||||
onSuggestionSelected?: OnSuggestionSelected<TSuggestion>;
|
||||
/**
|
||||
* Use it only if you need to customize the rendering of the input.
|
||||
*/
|
||||
renderInputComponent?: RenderInputComponent<TSuggestion>;
|
||||
/**
|
||||
* Use it if you want to customize things inside the suggestions container beyond rendering the suggestions themselves.
|
||||
*/
|
||||
renderSuggestionsContainer?: RenderSuggestionsContainer;
|
||||
/**
|
||||
* Use your imagination to define how section titles are rendered.
|
||||
*/
|
||||
renderSectionTitle?: RenderSectionTitle;
|
||||
/**
|
||||
* Use your imagination to define how suggestions are rendered.
|
||||
*/
|
||||
renderSuggestion: RenderSuggestion<TSuggestion>;
|
||||
/**
|
||||
* When the input is focused, Autosuggest will consult this function when to render suggestions.
|
||||
* Use it, for example, if you want to display suggestions when input value is at least 2 characters long.
|
||||
*/
|
||||
shouldRenderSuggestions?: ShouldRenderSuggestions;
|
||||
/**
|
||||
* These are the suggestions that will be displayed. Items can take an arbitrary shape.
|
||||
*/
|
||||
suggestions: TSuggestion[];
|
||||
/**
|
||||
* Use your imagination to style the Autosuggest.
|
||||
*/
|
||||
theme?: Theme;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,132 @@ export class ReactAutosuggestBasicTest extends React.Component<any, any> {
|
||||
};
|
||||
|
||||
return <Autosuggest
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={this
|
||||
.onSuggestionsFetchRequested
|
||||
.bind(this)}
|
||||
getSuggestionValue={this.getSuggestionValue}
|
||||
renderSuggestion={this.renderSuggestion}
|
||||
onSuggestionSelected={this.onSuggestionsSelected}
|
||||
alwaysRenderSuggestions={true}
|
||||
inputProps={inputProps}
|
||||
theme={theme}/>;
|
||||
}
|
||||
|
||||
protected onSuggestionsSelected(event: React.FormEvent<any>, data: Autosuggest.SuggestionSelectedEventData<Language>): void {
|
||||
alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`);
|
||||
}
|
||||
|
||||
protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): JSX.Element {
|
||||
const className = params.isHighlighted ? "highlighted" : undefined;
|
||||
return <span className={className}>{suggestion.name}</span>;
|
||||
}
|
||||
// endregion region Event handlers
|
||||
protected onChange(event: React.FormEvent<any>, {newValue, method}: any): void {
|
||||
this.setState({value: newValue});
|
||||
}
|
||||
|
||||
protected onSuggestionsFetchRequested({value}: any): void {
|
||||
this.setState({
|
||||
suggestions: this.getSuggestions(value)
|
||||
});
|
||||
}
|
||||
// endregion region Helper methods
|
||||
protected getSuggestions(value: string): Language[] {
|
||||
const escapedValue = escapeRegexCharacters(value.trim());
|
||||
|
||||
if (escapedValue === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
const regex = new RegExp('^' + escapedValue, 'i');
|
||||
|
||||
return ReactAutosuggestBasicTest
|
||||
.languages
|
||||
.filter(language => regex.test(language.name));
|
||||
}
|
||||
|
||||
protected getSuggestionValue(suggestion: Language): string { return suggestion.name; }
|
||||
// endregion
|
||||
}
|
||||
|
||||
const LanguageAutosuggest = Autosuggest as { new (): Autosuggest<Language> };
|
||||
|
||||
export class ReactAutosuggestTypedTest extends React.Component<any, any> {
|
||||
// region Fields
|
||||
static languages: Language[] = [
|
||||
{
|
||||
name: 'C',
|
||||
year: 1972
|
||||
}, {
|
||||
name: 'C#',
|
||||
year: 2000
|
||||
}, {
|
||||
name: 'C++',
|
||||
year: 1983
|
||||
}, {
|
||||
name: 'Clojure',
|
||||
year: 2007
|
||||
}, {
|
||||
name: 'Elm',
|
||||
year: 2012
|
||||
}, {
|
||||
name: 'Go',
|
||||
year: 2009
|
||||
}, {
|
||||
name: 'Haskell',
|
||||
year: 1990
|
||||
}, {
|
||||
name: 'Java',
|
||||
year: 1995
|
||||
}, {
|
||||
name: 'Javascript',
|
||||
year: 1995
|
||||
}, {
|
||||
name: 'Perl',
|
||||
year: 1987
|
||||
}, {
|
||||
name: 'PHP',
|
||||
year: 1995
|
||||
}, {
|
||||
name: 'Python',
|
||||
year: 1991
|
||||
}, {
|
||||
name: 'Ruby',
|
||||
year: 1995
|
||||
}, {
|
||||
name: 'Scala',
|
||||
year: 2003
|
||||
}
|
||||
];
|
||||
// endregion region Constructor
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
value: '',
|
||||
suggestions: this.getSuggestions('')
|
||||
};
|
||||
}
|
||||
// endregion region Rendering methods
|
||||
render(): JSX.Element {
|
||||
const {value, suggestions} = this.state;
|
||||
const inputProps = {
|
||||
placeholder: `Type 'c'`,
|
||||
value,
|
||||
onChange: this
|
||||
.onChange
|
||||
.bind(this)
|
||||
};
|
||||
|
||||
const theme = {
|
||||
input: 'themed-input-class',
|
||||
container: 'themed-container-class',
|
||||
suggestionFocused: 'active',
|
||||
sectionTitle: { color: 'blue' }
|
||||
};
|
||||
|
||||
return <LanguageAutosuggest
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={this
|
||||
.onSuggestionsFetchRequested
|
||||
@@ -240,7 +366,7 @@ export class ReactAutosuggestMultipleTest extends React.Component<any, any> {
|
||||
.bind(this)
|
||||
};
|
||||
|
||||
return <Autosuggest
|
||||
return <LanguageAutosuggest
|
||||
multiSection={true}
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={this
|
||||
@@ -272,7 +398,7 @@ export class ReactAutosuggestMultipleTest extends React.Component<any, any> {
|
||||
return <strong>{section.title}</strong>;
|
||||
}
|
||||
|
||||
protected renderInputComponent(inputProps: Autosuggest.InputProps): JSX.Element {
|
||||
protected renderInputComponent(inputProps: Autosuggest.InputProps<Language>): JSX.Element {
|
||||
return (
|
||||
<div>
|
||||
<input {...inputProps} />
|
||||
@@ -280,7 +406,7 @@ export class ReactAutosuggestMultipleTest extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
|
||||
protected renderSuggestionsContainer(containerProps: any, children: any, query: string): JSX.Element {
|
||||
protected renderSuggestionsContainer({containerProps, children, query}: Autosuggest.RenderSuggestionsContainerParams): JSX.Element {
|
||||
return (
|
||||
<div {...containerProps}>
|
||||
<span>{children}</span>
|
||||
@@ -345,6 +471,8 @@ interface Person {
|
||||
twitter: string;
|
||||
}
|
||||
|
||||
const PersonAutosuggest = Autosuggest as { new (): Autosuggest<Person> };
|
||||
|
||||
export class ReactAutosuggestCustomTest extends React.Component<any, any> {
|
||||
// region Fields
|
||||
static people: Person[] = [
|
||||
@@ -386,7 +514,7 @@ export class ReactAutosuggestCustomTest extends React.Component<any, any> {
|
||||
.bind(this)
|
||||
};
|
||||
|
||||
return<Autosuggest
|
||||
return<PersonAutosuggest
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
|
||||
getSuggestionValue={this.getSuggestionValue}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# [React Native Elements](https://github.com/react-native-training/react-native-elements)
|
||||
|
||||
### Component Checklist
|
||||
|
||||
- [x] Buttons
|
||||
- [x] Badge
|
||||
- [x] Social Icons / Social Icon Buttons
|
||||
- [x] Icons
|
||||
- [x] Side Menu
|
||||
- [x] Form Elements
|
||||
- [x] SearchBar
|
||||
- [x] ButtonGroup
|
||||
- [x] CheckBoxes
|
||||
- [x] List Element
|
||||
- [x] Tab Bar Component
|
||||
- [x] HTML style headings
|
||||
- [x] Card component
|
||||
- [x] Pricing Component
|
||||
- [x] Grid Component
|
||||
- [x] Slider Component
|
||||
- [x] Tile Component
|
||||
- [x] Avatar Component
|
||||
- [x] Rating Component
|
||||
- [x] SwipeDeck Component
|
||||
- [x] Header Component
|
||||
- [x] Divider
|
||||
-2265
File diff suppressed because it is too large
Load Diff
@@ -1,975 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
ListView,
|
||||
View,
|
||||
StyleSheet,
|
||||
TouchableNativeFeedback,
|
||||
Image,
|
||||
TextInput,
|
||||
Animated,
|
||||
Dimensions
|
||||
} from 'react-native';
|
||||
import {
|
||||
Button,
|
||||
Text,
|
||||
Badge,
|
||||
Avatar,
|
||||
Card,
|
||||
ButtonGroup,
|
||||
CheckBox,
|
||||
Divider,
|
||||
FormInput,
|
||||
FormValidationMessage,
|
||||
FormLabel,
|
||||
Header,
|
||||
Icon,
|
||||
List,
|
||||
ListItem,
|
||||
PricingCard,
|
||||
Rating,
|
||||
SearchBar,
|
||||
SideMenu,
|
||||
Slider,
|
||||
SocialIcon,
|
||||
SwipeDeck,
|
||||
Tabs,
|
||||
Tab,
|
||||
Tile,
|
||||
colors,
|
||||
getIconType,
|
||||
normalize
|
||||
} from 'react-native-elements';
|
||||
|
||||
const { width, height } = Dimensions.get('window');
|
||||
|
||||
class TextTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text h1>Heading 1</Text>
|
||||
<Text h2>Heading 2</Text>
|
||||
<Text h3>Heading 3</Text>
|
||||
<Text h4>Heading 4</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AvatarTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<View>
|
||||
<Text style={AvatarStyles.title}>Avatars</Text>
|
||||
<Avatar
|
||||
small
|
||||
rounded
|
||||
source={{
|
||||
uri:
|
||||
'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg'
|
||||
}}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
medium
|
||||
source={{
|
||||
uri:
|
||||
'https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg'
|
||||
}}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
large
|
||||
source={{
|
||||
uri:
|
||||
'https://s3.amazonaws.com/uifaces/faces/twitter/brynn/128.jpg'
|
||||
}}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
xlarge
|
||||
rounded
|
||||
source={{
|
||||
uri:
|
||||
'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg'
|
||||
}}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Text style={AvatarStyles.title}>Avatar with initials</Text>
|
||||
<Avatar
|
||||
small
|
||||
rounded
|
||||
title="MT"
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
medium
|
||||
title="BP"
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
large
|
||||
title="LW"
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
<Avatar
|
||||
xlarge
|
||||
rounded
|
||||
title="CR"
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Text style={AvatarStyles.title}>Avatar with icons</Text>
|
||||
<Avatar
|
||||
small
|
||||
rounded
|
||||
icon={{ name: 'user' }}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
containerStyle={{
|
||||
flex: 2,
|
||||
marginLeft: 20,
|
||||
marginTop: 115
|
||||
}}
|
||||
/>
|
||||
<Avatar
|
||||
medium
|
||||
overlayContainerStyle={{ backgroundColor: 'blue' }}
|
||||
icon={{ name: 'meetup', color: 'red' }}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
containerStyle={{ flex: 3, marginTop: 100 }}
|
||||
/>
|
||||
<Avatar
|
||||
large
|
||||
icon={{ name: 'rocket', color: 'orange' }}
|
||||
overlayContainerStyle={{ backgroundColor: 'white' }}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
containerStyle={{ flex: 4, marginTop: 75 }}
|
||||
/>
|
||||
<Avatar
|
||||
xlarge
|
||||
rounded
|
||||
icon={{ name: 'home' }}
|
||||
onPress={() => console.log('Works!')}
|
||||
activeOpacity={0.7}
|
||||
containerStyle={{ flex: 5, marginRight: 60 }}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const AvatarStyles = StyleSheet.create({
|
||||
title: {
|
||||
fontSize: 30,
|
||||
marginBottom: 10
|
||||
}
|
||||
});
|
||||
|
||||
class BadgeTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Badge value={3} textStyle={{ color: 'orange' }} />
|
||||
|
||||
<Badge containerStyle={{ backgroundColor: 'violet' }}>
|
||||
<Text>User 1</Text>
|
||||
</Badge>
|
||||
|
||||
<Badge onPress={() => console.log('pressed')} value="5" />
|
||||
|
||||
<Badge component={TouchableNativeFeedback} value={10} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ButtonTest extends React.Component<any, any> {
|
||||
handleButtonPress() {
|
||||
console.log('I got pressed');
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Button
|
||||
title="BUTTON"
|
||||
onPress={() => this.handleButtonPress()}
|
||||
/>
|
||||
|
||||
<Button
|
||||
raised
|
||||
icon={{ name: 'cached' }}
|
||||
title="BUTTON WITH ICON"
|
||||
onPress={() => this.handleButtonPress()}
|
||||
/>
|
||||
|
||||
<Button
|
||||
large
|
||||
iconRight = {{ name: 'code' }}
|
||||
title="LARGE WITH RIGHT ICON"
|
||||
onPress={() => this.handleButtonPress()}
|
||||
/>
|
||||
|
||||
<Button
|
||||
large
|
||||
icon={{ name: 'envira', type: 'font-awesome' }}
|
||||
title="LARGE WITH RIGHT ICON"
|
||||
onPress={() => this.handleButtonPress()}
|
||||
/>
|
||||
|
||||
<Button
|
||||
large
|
||||
icon={{
|
||||
name: 'squirrel',
|
||||
type: 'octicon',
|
||||
buttonStyle: ButtonStyles.someButtonStyle
|
||||
}}
|
||||
title="OCTICON"
|
||||
onPress={() => this.handleButtonPress()}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const ButtonStyles = StyleSheet.create({
|
||||
someButtonStyle: {
|
||||
color: 'pink'
|
||||
}
|
||||
});
|
||||
|
||||
class CardTest extends React.Component<any, any> {
|
||||
render() {
|
||||
const users = [
|
||||
{
|
||||
name: 'brynn',
|
||||
avatar:
|
||||
'https://s3.amazonaws.com/uifaces/faces/twitter/brynn/128.jpg'
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<View>
|
||||
{/* implemented without image with header */}
|
||||
<Card title="CARD WITH DIVIDER">
|
||||
{users.map((u, i) => {
|
||||
return (
|
||||
<View key={i}>
|
||||
<Image
|
||||
resizeMode="cover"
|
||||
source={{ uri: u.avatar }}
|
||||
/>
|
||||
<Text>{u.name}</Text>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</Card>
|
||||
|
||||
{/* implemented with Text and Button as children */}
|
||||
<Card title="HELLO WORLD" image={require('../images/pic2.jpg')}>
|
||||
<Text style={{ marginBottom: 10 }}>
|
||||
The idea with React Native Elements is more about
|
||||
component structure than actual design.
|
||||
</Text>
|
||||
<Button
|
||||
onPress={() => {}}
|
||||
icon={{ name: 'code' }}
|
||||
backgroundColor="#03A9F4"
|
||||
fontFamily="Lato"
|
||||
buttonStyle={{
|
||||
borderRadius: 0,
|
||||
marginLeft: 0,
|
||||
marginRight: 0,
|
||||
marginBottom: 0
|
||||
}}
|
||||
title="VIEW NOW"
|
||||
/>
|
||||
</Card>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const component1 = () => <Text>Hello</Text>;
|
||||
const component2 = () => <Text>World</Text>;
|
||||
const component3 = () => <Text>ButtonGroup</Text>;
|
||||
|
||||
class ButtonGroupTest extends React.Component<any, any> {
|
||||
state = {
|
||||
selectedIndexStrings: 2,
|
||||
selectedIndexObjects: 2
|
||||
};
|
||||
|
||||
updateIndexStrings = (selectedIndexStrings: number) => {
|
||||
this.setState({ selectedIndexStrings });
|
||||
}
|
||||
|
||||
updateIndexObjects = (selectedIndexObjects: number) => {
|
||||
this.setState({ selectedIndexObjects });
|
||||
}
|
||||
|
||||
render() {
|
||||
const buttonStrings = ['Hello', 'World', 'Buttons'];
|
||||
const buttonObjects = [
|
||||
{ element: component1 },
|
||||
{ element: component2 },
|
||||
{ element: component3 }
|
||||
];
|
||||
|
||||
const { selectedIndexStrings, selectedIndexObjects } = this.state;
|
||||
return (
|
||||
<View>
|
||||
<ButtonGroup
|
||||
onPress={this.updateIndexStrings}
|
||||
selectedIndex={selectedIndexStrings}
|
||||
buttons={buttonStrings}
|
||||
containerStyle={{ height: 100 }}
|
||||
/>
|
||||
<ButtonGroup
|
||||
onPress={this.updateIndexObjects}
|
||||
selectedIndex={selectedIndexObjects}
|
||||
buttons={buttonObjects}
|
||||
containerStyle={{ height: 100 }}
|
||||
component={TouchableNativeFeedback}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface CheckBoxTestState {
|
||||
checked: boolean;
|
||||
}
|
||||
class CheckBoxTest extends React.Component<any, CheckBoxTestState> {
|
||||
state = {
|
||||
checked: false
|
||||
};
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<CheckBox title="Click Here" checked={this.state.checked} />
|
||||
|
||||
<CheckBox
|
||||
center
|
||||
title="Click Here"
|
||||
checked={this.state.checked}
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
center
|
||||
title="Click Here"
|
||||
checkedIcon="dot-circle-o"
|
||||
uncheckedIcon="circle-o"
|
||||
checked={this.state.checked}
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
center
|
||||
title="Click Here to Remove This Item"
|
||||
iconRight
|
||||
iconType="material"
|
||||
checkedIcon="clear"
|
||||
uncheckedIcon="add"
|
||||
checkedColor="red"
|
||||
checked={this.state.checked}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DividerTest extends React.Component {
|
||||
render() {
|
||||
return <Divider style={{ backgroundColor: 'blue' }} />;
|
||||
}
|
||||
}
|
||||
|
||||
class FormTest extends React.Component<any, any> {
|
||||
input: FormInput;
|
||||
onChangeText(text: string) {
|
||||
console.log('changed text', text);
|
||||
}
|
||||
|
||||
storeFormInput = (input: any) => {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.input.focus();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<FormLabel>Name</FormLabel>
|
||||
<FormInput
|
||||
ref={this.storeFormInput}
|
||||
onChangeText={this.onChangeText}
|
||||
/>
|
||||
<FormValidationMessage>Error message</FormValidationMessage>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HeaderTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Header
|
||||
leftComponent={<View />}
|
||||
rightComponent={{ icon: 'home', style: { color: '#fff' } }}
|
||||
/>
|
||||
<Header>
|
||||
<View />
|
||||
<View />
|
||||
<View />
|
||||
</Header>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IconTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Icon name="rowing" />
|
||||
<Icon name="g-translate" color="#00aced" />
|
||||
<Icon name="sc-telegram" type="evilicon" color="#517fa4" />
|
||||
<Icon
|
||||
reverse
|
||||
name="ios-american-football"
|
||||
type="ionicon"
|
||||
color="#517fa4"
|
||||
/>
|
||||
<Icon
|
||||
raised
|
||||
name="heartbeat"
|
||||
type="font-awesome"
|
||||
color="#f50"
|
||||
onPress={() => console.log('hello')}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListTest extends React.Component<any, any> {
|
||||
list = [
|
||||
{
|
||||
title: 'Appointments',
|
||||
icon: 'av-timer'
|
||||
},
|
||||
{
|
||||
title: 'Trips',
|
||||
icon: 'flight-takeoff'
|
||||
}
|
||||
];
|
||||
|
||||
render() {
|
||||
return (
|
||||
<List>
|
||||
{this.list.map((item, i) => (
|
||||
<ListItem
|
||||
key={i}
|
||||
title={item.title}
|
||||
leftIcon={{ name: item.icon }}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PricingCardTest extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<PricingCard
|
||||
color="#4f9deb"
|
||||
title="Free"
|
||||
price="$0"
|
||||
info={['1 User', 'Basic Support', 'All Core Features']}
|
||||
button={{ title: 'GET STARTED', icon: 'flight-takeoff' }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RatingTest extends React.Component {
|
||||
ratingCompleted(rating: number) {
|
||||
console.log('Rating is: ' + rating);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Rating
|
||||
showRating
|
||||
onFinishRating={this.ratingCompleted}
|
||||
style={{ paddingVertical: 10 }}
|
||||
/>
|
||||
|
||||
<Rating
|
||||
showRating
|
||||
type="star"
|
||||
fractions={1}
|
||||
startingValue={3.6}
|
||||
readonly
|
||||
imageSize={40}
|
||||
onFinishRating={this.ratingCompleted}
|
||||
style={{ paddingVertical: 10 }}
|
||||
/>
|
||||
|
||||
<Rating
|
||||
type="heart"
|
||||
ratingCount={3}
|
||||
fractions={2}
|
||||
startingValue={1.57}
|
||||
imageSize={40}
|
||||
onFinishRating={this.ratingCompleted}
|
||||
showRating
|
||||
style={[{ paddingVertical: 10 }]}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SearchBarTest extends React.Component<any, any> {
|
||||
searchBar: SearchBar;
|
||||
input: TextInput;
|
||||
|
||||
componentDidMount() {
|
||||
this.searchBar.focus();
|
||||
}
|
||||
|
||||
onChangeText = (text: string) => {
|
||||
console.log('text has changed');
|
||||
}
|
||||
|
||||
onChangeTextAction = (text: string) => {
|
||||
if (text === 'awesome') {
|
||||
this.searchBar.blur();
|
||||
}
|
||||
if (text === 'this is fun') {
|
||||
this.searchBar.clearText();
|
||||
}
|
||||
}
|
||||
|
||||
storeRef(ref: SearchBar) {
|
||||
this.searchBar = ref;
|
||||
this.input = this.searchBar.input;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<SearchBar
|
||||
onChangeText={this.onChangeTextAction}
|
||||
placeholder="Type Here..."
|
||||
ref={this.storeRef}
|
||||
/>
|
||||
|
||||
<SearchBar
|
||||
noIcon
|
||||
onChangeText={this.onChangeText}
|
||||
placeholder="Type Here..."
|
||||
/>
|
||||
|
||||
<SearchBar
|
||||
round
|
||||
onChangeText={this.onChangeText}
|
||||
placeholder="Type Here..."
|
||||
/>
|
||||
|
||||
<SearchBar
|
||||
lightTheme
|
||||
onChangeText={this.onChangeText}
|
||||
placeholder="Type Here..."
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface SideMenuTestListItem {
|
||||
avatarURL: string;
|
||||
name: string;
|
||||
subtitle: string;
|
||||
}
|
||||
|
||||
interface SideMenuTestState {
|
||||
list: SideMenuTestListItem[];
|
||||
isOpen: boolean;
|
||||
}
|
||||
class SideMenuTest extends React.Component<any, SideMenuTestState> {
|
||||
state = {
|
||||
list: [
|
||||
{
|
||||
avatarURL: 'https://amy.com/img.jpg',
|
||||
name: 'Amy',
|
||||
subtitle: 'Coding Geek'
|
||||
},
|
||||
{
|
||||
avatarURL: 'https://john.com/img.jpg',
|
||||
name: 'John',
|
||||
subtitle: 'Love cooking'
|
||||
}
|
||||
],
|
||||
isOpen: false
|
||||
};
|
||||
onSideMenuChange(isOpen: boolean) {
|
||||
this.setState({
|
||||
isOpen
|
||||
});
|
||||
}
|
||||
|
||||
toggleSideMenu = () => {
|
||||
this.setState({
|
||||
isOpen: !this.state.isOpen
|
||||
});
|
||||
}
|
||||
|
||||
animationStyle = (value: number) => ({
|
||||
transform: [
|
||||
{
|
||||
translateX: value
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
animationFunction = (prop: Animated.Value, value: number) =>
|
||||
Animated.spring(prop, {
|
||||
toValue: value,
|
||||
friction: 8
|
||||
})
|
||||
|
||||
render() {
|
||||
const MenuComponent = (
|
||||
<View
|
||||
style={{ flex: 1, backgroundColor: '#ededed', paddingTop: 50 }}
|
||||
>
|
||||
<List containerStyle={{ marginBottom: 20 }}>
|
||||
{this.state.list.map((l, i) => (
|
||||
<ListItem
|
||||
roundAvatar
|
||||
onPress={() => console.log('Pressed')}
|
||||
avatar={l.avatarURL}
|
||||
key={i}
|
||||
title={l.name}
|
||||
subtitle={l.subtitle}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
</View>
|
||||
);
|
||||
|
||||
return (
|
||||
<SideMenu
|
||||
isOpen={this.state.isOpen}
|
||||
onChange={this.onSideMenuChange}
|
||||
menu={MenuComponent}
|
||||
animationStyle={this.animationStyle}
|
||||
animationFunction={this.animationFunction}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: 'blue'
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
title="test button"
|
||||
onPress={this.toggleSideMenu.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
</SideMenu>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface SliderTestState {
|
||||
value: number;
|
||||
}
|
||||
class SliderTest extends React.Component<any, SliderTestState> {
|
||||
state = {
|
||||
value: 0.2
|
||||
};
|
||||
|
||||
onValueChange = (value: number) => {
|
||||
this.setState({ value });
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
alignItems: 'stretch',
|
||||
justifyContent: 'center'
|
||||
}}
|
||||
>
|
||||
<Slider
|
||||
value={this.state.value}
|
||||
onValueChange={this.onValueChange}
|
||||
/>
|
||||
<Text>Value: {this.state.value}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const SocialIconTest: React.StatelessComponent = () => {
|
||||
return (
|
||||
<View>
|
||||
<SocialIcon type="twitter" />
|
||||
<SocialIcon raised={false} type="gitlab" />
|
||||
<SocialIcon light type="medium" />
|
||||
<SocialIcon light raised={false} type="medium" />
|
||||
<SocialIcon title="Sign In With Facebook" button type="facebook" />
|
||||
<SocialIcon title="Some Twitter Message" button type="twitter" />
|
||||
<SocialIcon button type="medium" />
|
||||
<SocialIcon button light type="instagram" />
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const DATA = [
|
||||
{
|
||||
id: 1,
|
||||
text: 'Amanda',
|
||||
age: 28,
|
||||
uri:
|
||||
'http://f9view.com/wp-content/uploads/2013/10/American-Beautiful-Girls-Wallpapers-Hollywood-Celebs-1920x1200px.jpg'
|
||||
},
|
||||
{ id: 2, text: 'Emma', age: 29, uri: 'https://i.imgur.com/FHxVpN4.jpg' },
|
||||
{
|
||||
id: 3,
|
||||
text: 'Scarlett',
|
||||
age: 25,
|
||||
uri: 'https://i.ytimg.com/vi/GOJZ5TIlc3M/maxresdefault.jpg'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
text: 'Keira',
|
||||
age: 27,
|
||||
uri:
|
||||
'http://www.bdprimeit.com/wp-content/uploads/Keira-Knightley-Most-beautiful-Hollywood-actress.jpg'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
text: 'Ashley',
|
||||
age: 30,
|
||||
uri:
|
||||
'https://s-media-cache-ak0.pinimg.com/736x/4c/89/67/4c8967fac1822eeddf09670565430fd5.jpg'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
text: 'Jennifer',
|
||||
age: 24,
|
||||
uri:
|
||||
'https://2.bp.blogspot.com/-Vy0NVWhQfKo/Ubma2Mx2YTI/AAAAAAAAH3s/LC_u8LRfm8o/s1600/aimee-teegarden-04.jpg'
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
text: 'Sarah',
|
||||
age: 28,
|
||||
uri:
|
||||
'https://s-media-cache-ak0.pinimg.com/736x/41/75/26/4175268906d97492e4a3175eab95c0f5.jpg'
|
||||
}
|
||||
];
|
||||
|
||||
class SwipeDeckTest extends React.Component {
|
||||
renderCard(card: any) {
|
||||
return (
|
||||
<Card
|
||||
key={card.id}
|
||||
containerStyle={{
|
||||
borderRadius: 10,
|
||||
width: width * 0.92,
|
||||
height: height - 165
|
||||
}}
|
||||
featuredTitle={`${card.text}, ${card.age}`}
|
||||
featuredTitleStyle={{
|
||||
position: 'absolute',
|
||||
left: 15,
|
||||
bottom: 10,
|
||||
fontSize: 30
|
||||
}}
|
||||
image={{ uri: card.uri }}
|
||||
imageStyle={{
|
||||
borderRadius: 10,
|
||||
width: width * 0.915,
|
||||
height: height - 165
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
onSwipeRight(card: any) {
|
||||
console.log('Card liked: ' + card.text);
|
||||
}
|
||||
|
||||
onSwipeLeft(card: any) {
|
||||
console.log('Card disliked: ' + card.text);
|
||||
}
|
||||
|
||||
renderNoMoreCards() {
|
||||
return (
|
||||
<Card
|
||||
containerStyle={{
|
||||
borderRadius: 10,
|
||||
width: width * 0.92,
|
||||
height: height - 165
|
||||
}}
|
||||
featuredTitle="No more cards"
|
||||
featuredTitleStyle={{ fontSize: 25 }}
|
||||
image={{ uri: 'https://i.imgflip.com/1j2oed.jpg' }}
|
||||
imageStyle={{
|
||||
borderRadius: 10,
|
||||
width: width * 0.915,
|
||||
height: height - 165
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<SwipeDeck
|
||||
data={DATA}
|
||||
renderCard={this.renderCard}
|
||||
renderNoMoreCards={this.renderNoMoreCards}
|
||||
onSwipeRight={this.onSwipeRight}
|
||||
onSwipeLeft={this.onSwipeLeft}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface TabTestState {
|
||||
selectedTab: string;
|
||||
}
|
||||
|
||||
class TabsTest extends React.Component<{}, TabTestState> {
|
||||
state = {
|
||||
selectedTab: 'profile'
|
||||
};
|
||||
|
||||
changeTab = (selectedTab: string) => {
|
||||
this.setState({ selectedTab });
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedTab } = this.state;
|
||||
return (
|
||||
<Tabs>
|
||||
<Tab
|
||||
titleStyle={{ fontWeight: 'bold', fontSize: 10 }}
|
||||
selectedTitleStyle={{ marginTop: -1, marginBottom: 6 }}
|
||||
selected={selectedTab === 'feed'}
|
||||
title={selectedTab === 'feed' ? 'FEED' : undefined}
|
||||
renderIcon={() => (
|
||||
<Icon
|
||||
containerStyle={{
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
marginTop: 12
|
||||
}}
|
||||
color={'#5e6977'}
|
||||
name="whatshot"
|
||||
size={33}
|
||||
/>
|
||||
)}
|
||||
renderSelectedIcon={() => (
|
||||
<Icon color={'#6296f9'} name="whatshot" size={30} />
|
||||
)}
|
||||
onPress={() => this.changeTab('feed')}
|
||||
>
|
||||
<View />
|
||||
</Tab>
|
||||
<Tab
|
||||
titleStyle={{ fontWeight: 'bold', fontSize: 10 }}
|
||||
selectedTitleStyle={{ marginTop: -1, marginBottom: 6 }}
|
||||
selected={selectedTab === 'profile'}
|
||||
title={selectedTab === 'profile' ? 'PROFILE' : undefined}
|
||||
renderIcon={() => (
|
||||
<Icon
|
||||
containerStyle={{
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
marginTop: 12
|
||||
}}
|
||||
color={'#5e6977'}
|
||||
name="person"
|
||||
size={33}
|
||||
/>
|
||||
)}
|
||||
renderSelectedIcon={() => (
|
||||
<Icon color={'#6296f9'} name="person" size={30} />
|
||||
)}
|
||||
onPress={() => this.changeTab('profile')}
|
||||
>
|
||||
<View />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const TileTest: React.StatelessComponent = () => (
|
||||
<View>
|
||||
<Tile
|
||||
imageSrc="image/path/awesome.jpeg"
|
||||
title="Lorem ipsum dolor sit amet, consectetur"
|
||||
icon={{ name: 'play-circle', type: 'font-awesome' }} // optional
|
||||
contentContainerStyle={{ height: 70 }}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between'
|
||||
}}
|
||||
>
|
||||
<Text>Caption</Text>
|
||||
<Text>Caption</Text>
|
||||
</View>
|
||||
</Tile>
|
||||
<Tile
|
||||
imageSrc="image/path/awesome.jpeg"
|
||||
icon={{ name: 'play-circle', type: 'font-awesome' }}
|
||||
featured
|
||||
/>
|
||||
|
||||
<Tile
|
||||
imageSrc="image/path/awesome.jpeg"
|
||||
title="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores dolore exercitationem"
|
||||
featured
|
||||
caption="Some Caption Text"
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
const CustomIcon = getIconType('material');
|
||||
const fontSize = normalize(20);
|
||||
const white = colors.white;
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-elements-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+8
-7
@@ -88,7 +88,7 @@ declare namespace React {
|
||||
}
|
||||
|
||||
interface ReactElement<P> {
|
||||
type: string | symbol | number | ComponentClass<P> | SFC<P>;
|
||||
type: string | ComponentClass<P> | SFC<P>;
|
||||
props: P;
|
||||
key: Key | null;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ declare namespace React {
|
||||
props?: ClassAttributes<T> & P,
|
||||
...children: ReactNode[]): CElement<P, T>;
|
||||
function createElement<P>(
|
||||
type: SFC<P> | ComponentClass<P> | string | symbol | number,
|
||||
type: SFC<P> | ComponentClass<P> | string,
|
||||
props?: Attributes & P,
|
||||
...children: ReactNode[]): ReactElement<P>;
|
||||
|
||||
@@ -265,7 +265,7 @@ declare namespace React {
|
||||
function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
|
||||
|
||||
const Children: ReactChildren;
|
||||
const Fragment: symbol | number;
|
||||
const Fragment: ComponentType;
|
||||
const version: string;
|
||||
|
||||
//
|
||||
@@ -281,10 +281,10 @@ declare namespace React {
|
||||
constructor(props: P, context?: any);
|
||||
|
||||
// Disabling unified-signatures to have separate overloads. It's easier to understand this way.
|
||||
// tslint:disable:unified-signatures
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
setState<K extends keyof S>(f: (prevState: Readonly<S>, props: P) => Pick<S, K>, callback?: () => any): void;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
setState<K extends keyof S>(state: Pick<S, K>, callback?: () => any): void;
|
||||
// tslint:enable:unified-signatures
|
||||
|
||||
forceUpdate(callBack?: () => any): void;
|
||||
render(): ReactNode;
|
||||
@@ -3519,7 +3519,7 @@ declare namespace React {
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
// tslint:disable:no-empty-interface
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface Element extends React.ReactElement<any> { }
|
||||
interface ElementClass extends React.Component<any> {
|
||||
render(): React.ReactNode;
|
||||
@@ -3527,9 +3527,10 @@ declare global {
|
||||
interface ElementAttributesProperty { props: {}; }
|
||||
interface ElementChildrenAttribute { children: {}; }
|
||||
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface IntrinsicAttributes extends React.Attributes { }
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
|
||||
// tslint:enable:no-empty-interface
|
||||
|
||||
interface IntrinsicElements {
|
||||
// HTML
|
||||
|
||||
@@ -164,7 +164,7 @@ const statelessElement: React.SFCElement<SCProps> = React.createElement(Stateles
|
||||
const domElement: React.DOMElement<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> = React.createElement("div");
|
||||
const htmlElement = React.createElement("input", { type: "text" });
|
||||
const svgElement = React.createElement("svg", { accentHeight: 12 });
|
||||
const fragmentElement: React.ReactElement<undefined> = React.createElement(React.Fragment, undefined, [React.createElement("div"), React.createElement("div")]);
|
||||
const fragmentElement: React.ReactElement<{}> = React.createElement(React.Fragment, {}, [React.createElement("div"), React.createElement("div")]);
|
||||
|
||||
const customProps: React.HTMLProps<HTMLElement> = props;
|
||||
const customDomElement = "my-element";
|
||||
@@ -229,7 +229,7 @@ const notValid: boolean = React.isValidElement(props); // false
|
||||
const isValid = React.isValidElement(element); // true
|
||||
let domNode: Element = ReactDOM.findDOMNode(component);
|
||||
domNode = ReactDOM.findDOMNode(domNode);
|
||||
const fragmentType: symbol | number = React.Fragment;
|
||||
const fragmentType: React.ComponentType = React.Fragment;
|
||||
|
||||
//
|
||||
// React Elements
|
||||
@@ -255,7 +255,7 @@ myComponent.reset();
|
||||
// Refs
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// tslint:disable:no-empty-interface
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface RCProps { }
|
||||
|
||||
class RefComponent extends React.Component<RCProps> {
|
||||
|
||||
@@ -63,3 +63,17 @@ const StatelessComponentWithoutProps: React.SFC = (props) => {
|
||||
return <div />;
|
||||
};
|
||||
<StatelessComponentWithoutProps />;
|
||||
|
||||
// Fragments
|
||||
<div>
|
||||
<React.Fragment>
|
||||
<React.Fragment key="foo">
|
||||
<span>Child 1</span>
|
||||
<span>Child 2</span>
|
||||
</React.Fragment>
|
||||
<React.Fragment key="bar">
|
||||
<span>Child 3</span>
|
||||
<span>Child 4</span>
|
||||
</React.Fragment>
|
||||
</React.Fragment>
|
||||
</div>;
|
||||
|
||||
Vendored
+80
-78
@@ -1,6 +1,10 @@
|
||||
// Type definitions for reactstrap 5.0
|
||||
// Project: https://github.com/reactstrap/reactstrap#readme
|
||||
// Definitions by: Ali Hammad Baig <https://github.com/alihammad>, Marco Falkenberg <https://github.com/mfal>, Danilo Barros <https://github.com/danilobjr>, Fábio Paiva <https://github.com/fabiopaiva>
|
||||
// Definitions by: Ali Hammad Baig <https://github.com/alihammad>
|
||||
// Marco Falkenberg <https://github.com/mfal>
|
||||
// Danilo Barros <https://github.com/danilobjr>
|
||||
// Fábio Paiva <https://github.com/fabiopaiva>
|
||||
// FaithForHumans <https://github.com/FaithForHumans>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -8,80 +12,78 @@ export interface CSSModule {
|
||||
[className: string]: string;
|
||||
}
|
||||
|
||||
export { default as Alert } from './lib/Alert';
|
||||
export { default as Badge } from './lib/Badge';
|
||||
export { default as Breadcrumb } from './lib/Breadcrumb';
|
||||
export { default as BreadcrumbItem } from './lib/BreadcrumbItem';
|
||||
export { default as Button } from './lib/Button';
|
||||
export { default as ButtonDropdown } from './lib/ButtonDropdown';
|
||||
export { default as ButtonGroup } from './lib/ButtonGroup';
|
||||
export { default as ButtonToolbar } from './lib/ButtonToolbar';
|
||||
export { default as Card } from './lib/Card';
|
||||
export { default as CardBody } from './lib/CardBody';
|
||||
export { default as CardBlock } from './lib/CardBlock';
|
||||
export { default as CardColumns } from './lib/CardColumns';
|
||||
export { default as CardDeck } from './lib/CardDeck';
|
||||
export { default as CardFooter } from './lib/CardFooter';
|
||||
export { default as CardGroup } from './lib/CardGroup';
|
||||
export { default as CardHeader } from './lib/CardHeader';
|
||||
export { default as CardImg } from './lib/CardImg';
|
||||
export { default as CardImgOverlay } from './lib/CardImgOverlay';
|
||||
export { default as CardLink } from './lib/CardLink';
|
||||
export { default as CardSubtitle } from './lib/CardSubtitle';
|
||||
export { default as CardText } from './lib/CardText';
|
||||
export { default as CardTitle } from './lib/CardTitle';
|
||||
export { default as Col } from './lib/Col';
|
||||
export { default as Collapse } from './lib/Collapse';
|
||||
export { default as Container } from './lib/Container';
|
||||
export { default as Dropdown } from './lib/Dropdown';
|
||||
export { default as DropdownItem } from './lib/DropdownItem';
|
||||
export { default as DropdownMenu } from './lib/DropdownMenu';
|
||||
export { default as DropdownToggle } from './lib/DropdownToggle';
|
||||
export { default as Fade } from './lib/Fade';
|
||||
export { default as Form } from './lib/Form';
|
||||
export { default as FormFeedback } from './lib/FormFeedback';
|
||||
export { default as FormGroup } from './lib/FormGroup';
|
||||
export { default as FormText } from './lib/FormText';
|
||||
export { default as Input } from './lib/Input';
|
||||
export { default as InputGroup } from './lib/InputGroup';
|
||||
export { default as InputGroupAddon } from './lib/InputGroupAddon';
|
||||
export { default as InputGroupButton } from './lib/InputGroupButton';
|
||||
export { default as Jumbotron } from './lib/Jumbotron';
|
||||
export { default as Label } from './lib/Label';
|
||||
export { default as ListGroup } from './lib/ListGroup';
|
||||
export { default as ListGroupItem } from './lib/ListGroupItem';
|
||||
export { default as ListGroupItemHeading } from './lib/ListGroupItemHeading';
|
||||
export { default as ListGroupItemText } from './lib/ListGroupItemText';
|
||||
export { default as Media } from './lib/Media';
|
||||
export { default as Modal } from './lib/Modal';
|
||||
export { default as ModalBody } from './lib/ModalBody';
|
||||
export { default as ModalFooter } from './lib/ModalFooter';
|
||||
export { default as ModalHeader } from './lib/ModalHeader';
|
||||
export { default as Nav } from './lib/Nav';
|
||||
export { default as Navbar } from './lib/Navbar';
|
||||
export { default as NavbarBrand } from './lib/NavbarBrand';
|
||||
export { default as NavbarToggler } from './lib/NavbarToggler';
|
||||
export { default as NavDropdown } from './lib/NavDropdown';
|
||||
export { default as NavItem } from './lib/NavItem';
|
||||
export { default as NavLink } from './lib/NavLink';
|
||||
export { default as Pagination } from './lib/Pagination';
|
||||
export { default as PaginationItem } from './lib/PaginationItem';
|
||||
export { default as PaginationLink } from './lib/PaginationLink';
|
||||
export { default as Popover } from './lib/Popover';
|
||||
export { default as PopoverBody } from './lib/PopoverBody';
|
||||
export { default as PopoverHeader } from './lib/PopoverHeader';
|
||||
export { default as Progress } from './lib/Progress';
|
||||
export { default as Row } from './lib/Row';
|
||||
export { default as TabContent } from './lib/TabContent';
|
||||
export { default as Table } from './lib/Table';
|
||||
export { default as TabPane } from './lib/TabPane';
|
||||
export { default as Tag } from './lib/Tag';
|
||||
export { default as TetherContent } from './lib/TetherContent';
|
||||
export { default as Tooltip } from './lib/Tooltip';
|
||||
export {
|
||||
UncontrolledAlert,
|
||||
UncontrolledButtonDropdown,
|
||||
UncontrolledDropdown,
|
||||
UncontrolledNavDropdown,
|
||||
UncontrolledTooltip
|
||||
} from './lib/Uncontrolled';
|
||||
export { default as Alert, AlertProps } from './lib/Alert';
|
||||
export { default as Badge, BadgeProps } from './lib/Badge';
|
||||
export { default as Breadcrumb, BreadcrumbProps } from './lib/Breadcrumb';
|
||||
export { default as BreadcrumbItem, BreadcrumbItemProps } from './lib/BreadcrumbItem';
|
||||
export { default as Button, ButtonProps } from './lib/Button';
|
||||
export { default as ButtonDropdown, ButtonDropdownProps } from './lib/ButtonDropdown';
|
||||
export { default as ButtonGroup, ButtonGroupProps } from './lib/ButtonGroup';
|
||||
export { default as ButtonToolbar, ButtonToolbarProps } from './lib/ButtonToolbar';
|
||||
export { default as Card, CardProps } from './lib/Card';
|
||||
export { default as CardBody, CardBodyProps } from './lib/CardBody';
|
||||
export { default as CardBlock, CardBlockProps } from './lib/CardBlock';
|
||||
export { default as CardColumns, CardColumnsProps } from './lib/CardColumns';
|
||||
export { default as CardDeck, CardDeckProps } from './lib/CardDeck';
|
||||
export { default as CardFooter, CardFooterProps } from './lib/CardFooter';
|
||||
export { default as CardGroup, CardGroupProps } from './lib/CardGroup';
|
||||
export { default as CardHeader, CardHeaderProps } from './lib/CardHeader';
|
||||
export { default as CardImg, CardImgProps } from './lib/CardImg';
|
||||
export { default as CardImgOverlay, CardImgOverlayProps } from './lib/CardImgOverlay';
|
||||
export { default as CardLink, CardLinkProps } from './lib/CardLink';
|
||||
export { default as CardSubtitle, CardSubtitleProps } from './lib/CardSubtitle';
|
||||
export { default as CardText, CardTextProps } from './lib/CardText';
|
||||
export { default as CardTitle, CardTitleProps } from './lib/CardTitle';
|
||||
export { default as Col, ColProps } from './lib/Col';
|
||||
export { default as Collapse, CollapseProps } from './lib/Collapse';
|
||||
export { default as Container, ContainerProps } from './lib/Container';
|
||||
export { default as Dropdown, DropdownProps } from './lib/Dropdown';
|
||||
export { default as DropdownItem, DropdownItemProps } from './lib/DropdownItem';
|
||||
export { default as DropdownMenu, DropdownMenuProps } from './lib/DropdownMenu';
|
||||
export { default as DropdownToggle, DropdownToggleProps } from './lib/DropdownToggle';
|
||||
export { default as Fade, FadeProps } from './lib/Fade';
|
||||
export { default as Form, FormProps } from './lib/Form';
|
||||
export { default as FormFeedback, FormFeedbackProps } from './lib/FormFeedback';
|
||||
export { default as FormGroup, FormGroupProps } from './lib/FormGroup';
|
||||
export { default as FormText, FormTextProps } from './lib/FormText';
|
||||
export { default as Input, InputProps } from './lib/Input';
|
||||
export { default as InputGroup, InputGroupProps } from './lib/InputGroup';
|
||||
export { default as InputGroupAddon, InputGroupAddonProps } from './lib/InputGroupAddon';
|
||||
export { default as InputGroupButton, InputGroupButtonProps } from './lib/InputGroupButton';
|
||||
export { default as Jumbotron, JumbotronProps } from './lib/Jumbotron';
|
||||
export { default as Label, LabelProps } from './lib/Label';
|
||||
export { default as ListGroup, ListGroupProps } from './lib/ListGroup';
|
||||
export { default as ListGroupItem, ListGroupItemProps } from './lib/ListGroupItem';
|
||||
export { default as ListGroupItemHeading, ListGroupItemHeadingProps } from './lib/ListGroupItemHeading';
|
||||
export { default as ListGroupItemText, ListGroupItemTextProps } from './lib/ListGroupItemText';
|
||||
export { default as Media, MediaProps } from './lib/Media';
|
||||
export { default as Modal, ModalProps } from './lib/Modal';
|
||||
export { default as ModalBody, ModalBodyProps } from './lib/ModalBody';
|
||||
export { default as ModalFooter, ModalFooterProps } from './lib/ModalFooter';
|
||||
export { default as ModalHeader, ModalHeaderProps } from './lib/ModalHeader';
|
||||
export { default as Nav, NavProps } from './lib/Nav';
|
||||
export { default as Navbar, NavbarProps } from './lib/Navbar';
|
||||
export { default as NavbarBrand, NavbarBrandProps } from './lib/NavbarBrand';
|
||||
export { default as NavbarToggler, NavbarTogglerProps } from './lib/NavbarToggler';
|
||||
export { default as NavDropdown, NavDropdownProps } from './lib/NavDropdown';
|
||||
export { default as NavItem, NavItemProps } from './lib/NavItem';
|
||||
export { default as NavLink, NavLinkProps } from './lib/NavLink';
|
||||
export { default as Pagination, PaginationProps } from './lib/Pagination';
|
||||
export { default as PaginationItem, PaginationItemProps } from './lib/PaginationItem';
|
||||
export { default as PaginationLink, PaginationLinkProps } from './lib/PaginationLink';
|
||||
export { default as Popover, PopoverProps } from './lib/Popover';
|
||||
export { default as PopoverBody, PopoverBodyProps } from './lib/PopoverBody';
|
||||
export { default as PopoverHeader, PopoverHeaderProps } from './lib/PopoverHeader';
|
||||
export { default as Progress, ProgressProps } from './lib/Progress';
|
||||
export { default as Row, RowProps } from './lib/Row';
|
||||
export { default as TabContent, TabContentProps } from './lib/TabContent';
|
||||
export { default as Table, TableProps } from './lib/Table';
|
||||
export { default as TabPane, TabPaneProps } from './lib/TabPane';
|
||||
export { default as Tag, TagProps } from './lib/Tag';
|
||||
export { default as TetherContent, TetherContentProps } from './lib/TetherContent';
|
||||
export { default as Tooltip, TooltipProps } from './lib/Tooltip';
|
||||
export { UncontrolledAlert, UncontrolledAlertProps } from './lib/Uncontrolled';
|
||||
export { UncontrolledButtonDropdown, UncontrolledButtonDropdownProps } from './lib/Uncontrolled';
|
||||
export { UncontrolledDropdown, UncontrolledDropdownProps } from './lib/Uncontrolled';
|
||||
export { UncontrolledNavDropdown, UncontrolledNavDropdownProps } from './lib/Uncontrolled';
|
||||
export { UncontrolledTooltip, UncontrolledTooltipProps } from './lib/Uncontrolled';
|
||||
|
||||
Vendored
+5
-2
@@ -9,11 +9,14 @@ export interface UncontrolledProps {
|
||||
transitionEnterTimeout?: number;
|
||||
transitionLeaveTimeout?: number;
|
||||
}
|
||||
export interface UncontrolledAlertProps extends UncontrolledProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
interface Props extends UncontrolledProps {
|
||||
export interface AlertProps extends UncontrolledAlertProps {
|
||||
isOpen?: boolean;
|
||||
toggle?: () => void;
|
||||
}
|
||||
|
||||
declare var Alert: React.StatelessComponent<Props>;
|
||||
declare const Alert: React.StatelessComponent<AlertProps>;
|
||||
export default Alert;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface BadgeProps {
|
||||
color?: string;
|
||||
pill?: boolean;
|
||||
tag?: React.ReactType;
|
||||
@@ -8,5 +8,5 @@ interface Props {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Badge: React.StatelessComponent<Props>;
|
||||
declare const Badge: React.StatelessComponent<BadgeProps>;
|
||||
export default Badge;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface BreadcrumbProps {
|
||||
tag?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Breadcrumb: React.StatelessComponent<Props>;
|
||||
declare const Breadcrumb: React.StatelessComponent<BreadcrumbProps>;
|
||||
export default Breadcrumb;
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface BreadcrumbItemProps {
|
||||
tag?: React.ReactType;
|
||||
active?: boolean;
|
||||
className?: string;
|
||||
@@ -10,6 +10,5 @@ interface Props {
|
||||
[others: string]: any;
|
||||
}
|
||||
|
||||
declare var BreadcrumbItem: React.StatelessComponent<Props>;
|
||||
declare const BreadcrumbItem: React.StatelessComponent<BreadcrumbItemProps>;
|
||||
export default BreadcrumbItem;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLButtonElement> {
|
||||
export interface ButtonProps extends React.HTMLProps<HTMLButtonElement> {
|
||||
outline?: boolean;
|
||||
active?: boolean;
|
||||
block?: boolean;
|
||||
@@ -17,5 +17,5 @@ interface Props extends React.HTMLProps<HTMLButtonElement> {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Button: React.StatelessComponent<Props>;
|
||||
declare const Button: React.StatelessComponent<ButtonProps>;
|
||||
export default Button;
|
||||
|
||||
+13
-10
@@ -1,12 +1,15 @@
|
||||
import {
|
||||
UncontrolledProps as DropdownUncontrolledProps,
|
||||
Props as DropdownProps
|
||||
} from './Dropdown';
|
||||
import { UncontrolledDropdownProps, DropdownProps } from './Dropdown';
|
||||
|
||||
// tslint:disable-next-line
|
||||
export interface UncontrolledProps extends DropdownUncontrolledProps { }
|
||||
// tslint:disable-next-line
|
||||
interface Props extends DropdownProps { }
|
||||
export interface UncontrolledProps extends UncontrolledDropdownProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
export interface UncontrolledButtonDropdownProps extends UncontrolledProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
declare var ButtonDropdown: React.StatelessComponent<Props>;
|
||||
export default ButtonDropdown;
|
||||
export interface ButtonDropdownProps extends DropdownProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
declare const ButtonDropdown: React.StatelessComponent<ButtonDropdownProps>;
|
||||
export default ButtonDropdown;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ButtonGroupProps {
|
||||
tag?: React.ReactType;
|
||||
'aria-label'?: string;
|
||||
className?: string;
|
||||
@@ -10,5 +10,5 @@ interface Props {
|
||||
vertical?: boolean;
|
||||
}
|
||||
|
||||
declare var ButtonGroup: React.StatelessComponent<Props>;
|
||||
declare const ButtonGroup: React.StatelessComponent<ButtonGroupProps>;
|
||||
export default ButtonGroup;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ButtonToolbarProps {
|
||||
tag?: React.ReactType;
|
||||
'aria-label'?: string;
|
||||
className?: string;
|
||||
@@ -8,5 +8,5 @@ interface Props {
|
||||
role?: string;
|
||||
}
|
||||
|
||||
declare var ButtonToolbar: React.StatelessComponent<Props>;
|
||||
declare const ButtonToolbar: React.StatelessComponent<ButtonToolbarProps>;
|
||||
export default ButtonToolbar;
|
||||
|
||||
Vendored
+2
-3
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardProps {
|
||||
tag?: React.ReactType;
|
||||
inverse?: boolean;
|
||||
color?: string;
|
||||
@@ -11,6 +11,5 @@ interface Props {
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
declare var Card: React.StatelessComponent<Props>;
|
||||
declare const Card: React.StatelessComponent<CardProps>;
|
||||
export default Card;
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -1,11 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardBlockProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardBlock: React.StatelessComponent<Props>;
|
||||
declare const CardBlock: React.StatelessComponent<CardBlockProps>;
|
||||
export default CardBlock;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardBodyProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardBody: React.StatelessComponent<Props>;
|
||||
declare const CardBody: React.StatelessComponent<CardBodyProps>;
|
||||
export default CardBody;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardColumnsProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardColumns: React.StatelessComponent<Props>;
|
||||
declare const CardColumns: React.StatelessComponent<CardColumnsProps>;
|
||||
export default CardColumns;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardDeckProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardDeck: React.StatelessComponent<Props>;
|
||||
declare const CardDeck: React.StatelessComponent<CardDeckProps>;
|
||||
export default CardDeck;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardFooterProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardFooter: React.StatelessComponent<Props>;
|
||||
declare const CardFooter: React.StatelessComponent<CardFooterProps>;
|
||||
export default CardFooter;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardGroupProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardGroup: React.StatelessComponent<Props>;
|
||||
declare const CardGroup: React.StatelessComponent<CardGroupProps>;
|
||||
export default CardGroup;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardHeaderProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardHeader: React.StatelessComponent<Props>;
|
||||
declare const CardHeader: React.StatelessComponent<CardHeaderProps>;
|
||||
export default CardHeader;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardImgProps {
|
||||
tag?: React.ReactType;
|
||||
top?: boolean;
|
||||
bottom?: boolean;
|
||||
@@ -12,5 +12,5 @@ interface Props {
|
||||
alt?: string;
|
||||
}
|
||||
|
||||
declare var CardImg: React.StatelessComponent<Props>;
|
||||
declare const CardImg: React.StatelessComponent<CardImgProps>;
|
||||
export default CardImg;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardImgOverlayProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardImgOverlay: React.StatelessComponent<Props>;
|
||||
declare const CardImgOverlay: React.StatelessComponent<CardImgOverlayProps>;
|
||||
export default CardImgOverlay;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardLinkProps {
|
||||
tag?: React.ReactType;
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
className?: string;
|
||||
@@ -8,5 +8,5 @@ interface Props {
|
||||
href?: string;
|
||||
}
|
||||
|
||||
declare var CardLink: React.StatelessComponent<Props>;
|
||||
declare const CardLink: React.StatelessComponent<CardLinkProps>;
|
||||
export default CardLink;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardSubtitleProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardSubtitle: React.StatelessComponent<Props>;
|
||||
declare const CardSubtitle: React.StatelessComponent<CardSubtitleProps>;
|
||||
export default CardSubtitle;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardTextProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardText: React.StatelessComponent<Props>;
|
||||
declare const CardText: React.StatelessComponent<CardTextProps>;
|
||||
export default CardText;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface CardTitleProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardTitle: React.StatelessComponent<Props>;
|
||||
declare const CardTitle: React.StatelessComponent<CardTitleProps>;
|
||||
export default CardTitle;
|
||||
|
||||
Vendored
+2
-2
@@ -9,7 +9,7 @@ export type ColumnProps
|
||||
offset?: string | number
|
||||
};
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
export interface ColProps extends React.HTMLProps<HTMLDivElement> {
|
||||
xs?: ColumnProps;
|
||||
sm?: ColumnProps;
|
||||
md?: ColumnProps;
|
||||
@@ -20,5 +20,5 @@ interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
widths?: string[];
|
||||
}
|
||||
|
||||
declare var Col: React.StatelessComponent<Props>;
|
||||
declare const Col: React.StatelessComponent<ColProps>;
|
||||
export default Col;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLElement> {
|
||||
export interface CollapseProps extends React.HTMLProps<HTMLElement> {
|
||||
isOpen?: boolean;
|
||||
classNames?: string;
|
||||
cssModule?: CSSModule;
|
||||
@@ -14,5 +14,5 @@ interface Props extends React.HTMLProps<HTMLElement> {
|
||||
onClosed?: () => void;
|
||||
}
|
||||
|
||||
declare var Collapse: React.StatelessComponent<Props>;
|
||||
declare const Collapse: React.StatelessComponent<CollapseProps>;
|
||||
export default Collapse;
|
||||
|
||||
Vendored
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ContainerProps {
|
||||
tag?: React.ReactType;
|
||||
fluid?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Container: React.StatelessComponent<Props>;
|
||||
declare const Container: React.StatelessComponent<ContainerProps>;
|
||||
export default Container;
|
||||
|
||||
Vendored
+7
-1
@@ -8,6 +8,9 @@ export interface UncontrolledProps {
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
export interface UncontrolledDropdownProps extends UncontrolledProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
export interface Props extends UncontrolledProps {
|
||||
disabled?: boolean;
|
||||
@@ -17,6 +20,9 @@ export interface Props extends UncontrolledProps {
|
||||
tag?: React.ReactType;
|
||||
tether?: boolean | Tether.ITetherOptions;
|
||||
}
|
||||
export interface DropdownProps extends Props {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
declare var Dropdown: React.StatelessComponent<Props>;
|
||||
declare const Dropdown: React.StatelessComponent<DropdownProps>;
|
||||
export default Dropdown;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface DropdownItemProps {
|
||||
disabled?: boolean;
|
||||
divider?: boolean;
|
||||
tag?: React.ReactType;
|
||||
@@ -12,5 +12,5 @@ interface Props {
|
||||
toggle?: boolean;
|
||||
}
|
||||
|
||||
declare var DropdownItem: React.StatelessComponent<Props>;
|
||||
declare const DropdownItem: React.StatelessComponent<DropdownItemProps>;
|
||||
export default DropdownItem;
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface DropdownMenuProps {
|
||||
tag?: React.ReactType;
|
||||
right?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var DropdownMenu: React.StatelessComponent<Props>;
|
||||
declare const DropdownMenu: React.StatelessComponent<DropdownMenuProps>;
|
||||
export default DropdownMenu;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface DropdownToggleProps {
|
||||
caret?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
@@ -15,5 +15,5 @@ interface Props {
|
||||
size?: string;
|
||||
}
|
||||
|
||||
declare var DropdownToggle: React.StatelessComponent<Props>;
|
||||
declare const DropdownToggle: React.StatelessComponent<DropdownToggleProps>;
|
||||
export default DropdownToggle;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface FadeProps {
|
||||
baseClass?: string;
|
||||
baseClassIn?: string;
|
||||
tag?: React.ReactType;
|
||||
@@ -16,5 +16,5 @@ interface Props {
|
||||
onEnter?: () => void;
|
||||
}
|
||||
|
||||
declare var Fade: React.StatelessComponent<Props>;
|
||||
declare const Fade: React.StatelessComponent<FadeProps>;
|
||||
export default Fade;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLFormElement> {
|
||||
export interface FormProps extends React.HTMLProps<HTMLFormElement> {
|
||||
inline?: boolean;
|
||||
tag?: React.ReactType;
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
@@ -8,5 +8,5 @@ interface Props extends React.HTMLProps<HTMLFormElement> {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Form: React.StatelessComponent<Props>;
|
||||
declare const Form: React.StatelessComponent<FormProps>;
|
||||
export default Form;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface FormFeedbackProps {
|
||||
tag?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormFeedback: React.StatelessComponent<Props>;
|
||||
declare const FormFeedback: React.StatelessComponent<FormFeedbackProps>;
|
||||
export default FormFeedback;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
export interface FormGroupProps extends React.HTMLProps<HTMLDivElement> {
|
||||
row?: boolean;
|
||||
check?: boolean;
|
||||
disabled?: boolean;
|
||||
@@ -10,5 +10,5 @@ interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormGroup: React.StatelessComponent<Props>;
|
||||
declare const FormGroup: React.StatelessComponent<FormGroupProps>;
|
||||
export default FormGroup;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface FormTextProps {
|
||||
inline?: boolean;
|
||||
tag?: React.ReactType;
|
||||
color?: string;
|
||||
@@ -8,5 +8,5 @@ interface Props {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormText: React.StatelessComponent<Props>;
|
||||
declare const FormText: React.StatelessComponent<FormTextProps>;
|
||||
export default FormText;
|
||||
|
||||
Vendored
+2
-2
@@ -33,7 +33,7 @@ interface Intermediate extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
size?: any;
|
||||
}
|
||||
|
||||
interface InputProps extends Intermediate {
|
||||
export interface InputProps extends Intermediate {
|
||||
type?: InputType;
|
||||
size?: string;
|
||||
state?: string;
|
||||
@@ -46,5 +46,5 @@ interface InputProps extends Intermediate {
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Input: React.StatelessComponent<InputProps>;
|
||||
declare const Input: React.StatelessComponent<InputProps>;
|
||||
export default Input;
|
||||
|
||||
Vendored
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface InputGroupProps {
|
||||
tag?: React.ReactType;
|
||||
size?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var InputGroup: React.StatelessComponent<Props>;
|
||||
declare const InputGroup: React.StatelessComponent<InputGroupProps>;
|
||||
export default InputGroup;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface InputGroupAddonProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var InputGroupAddon: React.StatelessComponent<Props>;
|
||||
declare const InputGroupAddon: React.StatelessComponent<InputGroupAddonProps>;
|
||||
export default InputGroupAddon;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface InputGroupButtonProps {
|
||||
tag?: React.ReactType;
|
||||
groupClassName?: string;
|
||||
groupAttributes?: any;
|
||||
@@ -9,5 +9,5 @@ interface Props {
|
||||
color?: string;
|
||||
}
|
||||
|
||||
declare var InputGroupButton: React.StatelessComponent<Props>;
|
||||
declare const InputGroupButton: React.StatelessComponent<InputGroupButtonProps>;
|
||||
export default InputGroupButton;
|
||||
|
||||
Vendored
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface JumbotronProps {
|
||||
tag?: React.ReactType;
|
||||
fluid?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Jumbotron: React.StatelessComponent<Props>;
|
||||
declare const Jumbotron: React.StatelessComponent<JumbotronProps>;
|
||||
export default Jumbotron;
|
||||
|
||||
Vendored
+2
-2
@@ -5,7 +5,7 @@ interface Intermediate extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
||||
size?: any;
|
||||
}
|
||||
|
||||
interface Props extends Intermediate {
|
||||
export interface LabelProps extends Intermediate {
|
||||
hidden?: boolean;
|
||||
check?: boolean;
|
||||
inline?: boolean;
|
||||
@@ -22,5 +22,5 @@ interface Props extends Intermediate {
|
||||
xl?: ColumnProps;
|
||||
}
|
||||
|
||||
declare var Label: React.StatelessComponent<Props>;
|
||||
declare const Label: React.StatelessComponent<LabelProps>;
|
||||
export default Label;
|
||||
|
||||
Vendored
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ListGroupProps {
|
||||
tag?: React.ReactType;
|
||||
flush?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroup: React.StatelessComponent<Props>;
|
||||
declare const ListGroup: React.StatelessComponent<ListGroupProps>;
|
||||
export default ListGroup;
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ListGroupItemProps {
|
||||
tag?: React.ReactType;
|
||||
active?: boolean;
|
||||
disabled?: boolean;
|
||||
@@ -9,9 +9,9 @@ interface Props {
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
href?: string;
|
||||
|
||||
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
}
|
||||
|
||||
declare var ListGroupItem: React.StatelessComponent<Props>;
|
||||
declare const ListGroupItem: React.StatelessComponent<ListGroupItemProps>;
|
||||
export default ListGroupItem;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ListGroupItemHeadingProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroupItemHeading: React.StatelessComponent<Props>;
|
||||
declare const ListGroupItemHeading: React.StatelessComponent<ListGroupItemHeadingProps>;
|
||||
export default ListGroupItemHeading;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ListGroupItemTextProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroupItemText: React.StatelessComponent<Props>;
|
||||
declare const ListGroupItemText: React.StatelessComponent<ListGroupItemTextProps>;
|
||||
export default ListGroupItemText;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface MediaProps {
|
||||
body?: boolean;
|
||||
bottom?: boolean;
|
||||
className?: string;
|
||||
@@ -17,5 +17,5 @@ interface Props {
|
||||
alt?: string;
|
||||
}
|
||||
|
||||
declare var Media: React.StatelessComponent<Props>;
|
||||
declare const Media: React.StatelessComponent<MediaProps>;
|
||||
export default Media;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ModalProps {
|
||||
isOpen?: boolean;
|
||||
autoFocus?: boolean;
|
||||
size?: string;
|
||||
@@ -19,5 +19,5 @@ interface Props {
|
||||
fade?: boolean;
|
||||
}
|
||||
|
||||
declare var Modal: React.StatelessComponent<Props>;
|
||||
declare const Modal: React.StatelessComponent<ModalProps>;
|
||||
export default Modal;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ModalBodyProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ModalBody: React.StatelessComponent<Props>;
|
||||
declare const ModalBody: React.StatelessComponent<ModalBodyProps>;
|
||||
export default ModalBody;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ModalFooterProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ModalFooter: React.StatelessComponent<Props>;
|
||||
declare const ModalFooter: React.StatelessComponent<ModalFooterProps>;
|
||||
export default ModalFooter;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface ModalHeaderProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
@@ -8,5 +8,5 @@ interface Props {
|
||||
toggle?: () => void;
|
||||
}
|
||||
|
||||
declare var ModalHeader: React.StatelessComponent<Props>;
|
||||
declare const ModalHeader: React.StatelessComponent<ModalHeaderProps>;
|
||||
export default ModalHeader;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLUListElement> {
|
||||
export interface NavProps extends React.HTMLProps<HTMLUListElement> {
|
||||
inline?: boolean;
|
||||
disabled?: boolean;
|
||||
tabs?: boolean;
|
||||
@@ -13,5 +13,5 @@ interface Props extends React.HTMLProps<HTMLUListElement> {
|
||||
vertical?: boolean;
|
||||
}
|
||||
|
||||
declare var Nav: React.StatelessComponent<Props>;
|
||||
declare const Nav: React.StatelessComponent<NavProps>;
|
||||
export default Nav;
|
||||
|
||||
+13
-10
@@ -1,12 +1,15 @@
|
||||
import {
|
||||
UncontrolledProps as DropdownUncontrolledProps,
|
||||
Props as DropdownProps
|
||||
} from './Dropdown';
|
||||
import { UncontrolledDropdownProps, DropdownProps } from './Dropdown';
|
||||
|
||||
// tslint:disable-next-line
|
||||
export interface UncontrolledProps extends DropdownUncontrolledProps { }
|
||||
// tslint:disable-next-line
|
||||
interface Props extends DropdownProps { }
|
||||
export interface UncontrolledProps extends UncontrolledDropdownProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
export interface UncontrolledNavDropdownProps extends UncontrolledProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
declare var NavDropdown: React.StatelessComponent<Props>;
|
||||
export default NavDropdown;
|
||||
export interface NavDropdownProps extends DropdownProps {
|
||||
/* intentionally blank */
|
||||
}
|
||||
|
||||
declare const NavDropdown: React.StatelessComponent<NavDropdownProps>;
|
||||
export default NavDropdown;
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface NavItemProps {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var NavItem: React.StatelessComponent<Props>;
|
||||
declare const NavItem: React.StatelessComponent<NavItemProps>;
|
||||
export default NavItem;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
export interface NavLinkProps extends React.HTMLProps<HTMLAnchorElement> {
|
||||
tag?: React.ReactType;
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
disabled?: boolean;
|
||||
@@ -11,5 +11,5 @@ interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
href?: string;
|
||||
}
|
||||
|
||||
declare var NavLink: React.StatelessComponent<Props>;
|
||||
declare const NavLink: React.StatelessComponent<NavLinkProps>;
|
||||
export default NavLink;
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
export interface NavbarProps {
|
||||
light?: boolean;
|
||||
dark?: boolean;
|
||||
inverse?: boolean;
|
||||
@@ -16,5 +16,5 @@ interface Props {
|
||||
expand?: boolean | string;
|
||||
}
|
||||
|
||||
declare var Navbar: React.StatelessComponent<Props>;
|
||||
declare const Navbar: React.StatelessComponent<NavbarProps>;
|
||||
export default Navbar;
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
export interface NavbarBrandProps extends React.HTMLProps<HTMLAnchorElement> {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var NavbarBrand: React.StatelessComponent<Props>;
|
||||
declare const NavbarBrand: React.StatelessComponent<NavbarBrandProps>;
|
||||
export default NavbarBrand;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
export interface NavbarTogglerProps extends React.HTMLProps<HTMLAnchorElement> {
|
||||
tag?: React.ReactType;
|
||||
type?: string;
|
||||
className?: string;
|
||||
@@ -9,5 +9,5 @@ interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
left?: boolean;
|
||||
}
|
||||
|
||||
declare var NavbarToggler: React.StatelessComponent<Props>;
|
||||
declare const NavbarToggler: React.StatelessComponent<NavbarTogglerProps>;
|
||||
export default NavbarToggler;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user