mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Merge master into release-2.0 on 07/28 (#10348)
* Changed AtomicBlockUtils and KeyBindingUtil from interfaces to classes with static functions (#10324) * Fixing a few minor issues in webpack-stream. (#10253) * Document changes in 0.28 and 0.29 in React Native (#10309) * RN: Widen limit of refreshControl * RN: Update NavigationExperimental to 0.28 * RN: Define new method from 0.28 * RN: Promisify requestPermissions per 0.28 * RN: Remove onNavigate method See: https://github.com/facebook/react-native/commit/fb0007d85323909ab652bf97166744fa7e17daab#diff-04c37ff76f85aea35e8475617539b75fR94 * RN: Add onNavigateBack method See: https://github.com/facebook/react-native/commit/fb0007d85323909ab652bf97166744fa7e17daab#diff-04c37ff76f85aea35e8475617539b75fR94 * RN: Deprecate StatusBarIOS * RN: Update StyleSheet API per 0.29 * RN: Define KeyboardAvoidingView added in 0.29 * RN: Define saveToCameraRoll added in 0.29 * RN: Define cancellable from InteractionManager * RN: Add new possible values of flexDirection * RN: Define lineBreakMode * RN: Allow zIndex prop * RN: Allow dimension limits * RN: Specify type of refreshControl * RN: Mark properties as optional * RN: Clarify parameter naming * RN: Mark optional property as optional * RN: Definite explicit ref type * RN: Restore StyleSheet.create to restore compatibility * Added Headers constructor options to whatwg-fetch (#10313) * Impl: Updated definitions for oracledb (#10323) * Update select2 to have selectOnClose option (#10326) Option documented at https://select2.github.io/options.html#can-i-select-the-highlighted-result-when-the-dropdown-is-closed * Added definition for react-file-input React component (#10325) * Added definition for react-file-input React component * Added newline at end of file * Added definitions for the react-file-reader-input react component. (#10327) * Sleep (#10333) * Add Electron specific versions to process.versions (#10320) * Fix uuid.js definitions. (#10318) * protobufjs: updated Message interfaces (#10198) * protobufjs: updated Message interfaces * Added ProtoBuf.Util interface * Fixed load functions of ProtoBuf namespace Base on the protobuf.js API docmentation. * use {} instead of Object Fixed according to PR commit note. * Multiple minor fixes (#10339) * better typing of onShouldStartLoadWithRequest in WebViewPropertiesIOS * Fixes to WebViewProperties * Missing methods in Navigator * Fix of Platform.select() * added support for interfacing with native-modules * added support for interfacing with native-modules * added dev variable * Update to header notes * Examples: alternative styles declaration * webcomponents.js: Add typings for Element.createShadowRoot (#10330) * webcomponents.js: Add typings for Element.createShadowRoot createShadowRoot is deprecated in the official Shadow DOM spec, but is the way to attach a shadow root in the current released version of webcomponents.js. * webcomponents.js: remove spurious extra line * webcomponents.js: remove readonly modifier Not supported until TS2. * webcomponents.js: add Element.shadowRoot property * Adding a couple missing highcharts properites (#10340) * Adding a couple missing highcharts properites * Fixing indentation * Indentation * Move change from master to its corresponding index.d.ts
This commit is contained in:
Vendored
+6
-6
@@ -178,17 +178,17 @@ declare namespace Draft {
|
||||
namespace Utils {
|
||||
import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand;
|
||||
|
||||
interface KeyBindingUtil {
|
||||
class KeyBindingUtil {
|
||||
/**
|
||||
* Check whether the ctrlKey modifier is *not* being used in conjunction with
|
||||
* the altKey modifier. If they are combined, the result is an `altGraph`
|
||||
* key modifier, which should not be handled by this set of key bindings.
|
||||
*/
|
||||
isCtrlKeyCommand(e: SyntheticKeyboardEvent): boolean;
|
||||
static isCtrlKeyCommand(e: SyntheticKeyboardEvent): boolean;
|
||||
|
||||
isOptionKeyCommand(e: SyntheticKeyboardEvent): boolean;
|
||||
static isOptionKeyCommand(e: SyntheticKeyboardEvent): boolean;
|
||||
|
||||
hasCommandModifier(e: SyntheticKeyboardEvent): boolean;
|
||||
static hasCommandModifier(e: SyntheticKeyboardEvent): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -795,8 +795,8 @@ declare namespace Draft {
|
||||
|
||||
type URI = any;
|
||||
|
||||
interface AtomicBlockUtils {
|
||||
insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState;
|
||||
class AtomicBlockUtils {
|
||||
static insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -766,6 +766,8 @@ let image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png');
|
||||
// process
|
||||
// https://github.com/electron/electron/blob/master/docs/api/process.md
|
||||
|
||||
console.log(process.versions.electron);
|
||||
console.log(process.versions.chrome);
|
||||
console.log(process.type);
|
||||
console.log(process.resourcesPath);
|
||||
console.log(process.mas);
|
||||
|
||||
Vendored
+12
@@ -5107,6 +5107,18 @@ interface File {
|
||||
// https://github.com/electron/electron/blob/master/docs/api/process.md
|
||||
|
||||
declare namespace NodeJS {
|
||||
|
||||
interface ProcessVersions {
|
||||
/**
|
||||
* Electron's version string.
|
||||
*/
|
||||
electron: string;
|
||||
/**
|
||||
* Chrome's version string.
|
||||
*/
|
||||
chrome: string;
|
||||
}
|
||||
|
||||
interface Process {
|
||||
/**
|
||||
* Setting this to true can disable the support for asar archives in Node's built-in modules.
|
||||
|
||||
@@ -2258,6 +2258,7 @@ function test_PointObject() {
|
||||
var point = <HighchartsPointObject>$('#container').highcharts().get('point1');
|
||||
var category = point.category;
|
||||
var percentage = point.percentage;
|
||||
point.index;
|
||||
point.remove();
|
||||
point.remove(false);
|
||||
point.remove(false, {duration: 50});
|
||||
|
||||
Vendored
+20
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Highcharts 4.1.9
|
||||
// Type definitions for Highcharts 4.2.5
|
||||
// Project: http://www.highcharts.com/
|
||||
// Definitions by: Damiano Gambarotto <http://github.com/damianog>, Dan Lewi Harkestad <http://github.com/baltie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -4820,6 +4820,17 @@ interface HighchartsPlotOptions {
|
||||
*/
|
||||
interface HighchartsIndividualSeriesOptions {
|
||||
type?: string;
|
||||
/**
|
||||
* The main color or the series. In line type series it applies to the line and the point markers unless otherwise
|
||||
* specified. In bar type series it applies to the bars unless a color is specified per point. The default
|
||||
* value is pulled from the options.colors array.
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user
|
||||
* that the points and lines can be clicked.
|
||||
*/
|
||||
cursor?: string;
|
||||
/**
|
||||
* An array of data points for the series. For the area series type, points can be given in the following ways:
|
||||
*
|
||||
@@ -4870,6 +4881,11 @@ interface HighchartsIndividualSeriesOptions {
|
||||
* The name of the series as shown in the legend, tooltip etc.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from
|
||||
* the pointPadding and groupPadding.
|
||||
*/
|
||||
pointWidth?: number;
|
||||
/**
|
||||
* This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything
|
||||
* else, as long as the grouped series' stack options match each other.
|
||||
@@ -5476,12 +5492,12 @@ interface HighchartsOptions {
|
||||
* The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the
|
||||
* vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects.
|
||||
*/
|
||||
xAxis?: HighchartsAxisOptions | HighchartsAxisOptions[];
|
||||
xAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions;
|
||||
/**
|
||||
* The Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the
|
||||
* horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects.
|
||||
*/
|
||||
yAxis?: HighchartsAxisOptions | HighchartsAxisOptions[];
|
||||
yAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions;
|
||||
|
||||
}
|
||||
|
||||
@@ -6103,6 +6119,7 @@ interface HighchartsPointObject {
|
||||
*/
|
||||
category: string | number;
|
||||
name: string;
|
||||
index: number;
|
||||
/**
|
||||
* The percentage for points in a stacked series or pies.
|
||||
* @since 1.2.0
|
||||
|
||||
Vendored
+12
-10
@@ -317,6 +317,17 @@ declare namespace NodeJS {
|
||||
heapUsed: number;
|
||||
}
|
||||
|
||||
export interface ProcessVersions {
|
||||
http_parser: string;
|
||||
node: string;
|
||||
v8: string;
|
||||
ares: string;
|
||||
uv: string;
|
||||
zlib: string;
|
||||
modules: string;
|
||||
openssl: string;
|
||||
}
|
||||
|
||||
export interface Process extends EventEmitter {
|
||||
stdout: WritableStream;
|
||||
stderr: WritableStream;
|
||||
@@ -336,16 +347,7 @@ declare namespace NodeJS {
|
||||
setuid(id: number): void;
|
||||
setuid(id: string): void;
|
||||
version: string;
|
||||
versions: {
|
||||
http_parser: string;
|
||||
node: string;
|
||||
v8: string;
|
||||
ares: string;
|
||||
uv: string;
|
||||
zlib: string;
|
||||
modules: string;
|
||||
openssl: string;
|
||||
};
|
||||
versions: ProcessVersions;
|
||||
config: {
|
||||
target_defaults: {
|
||||
cflags: any[];
|
||||
|
||||
Vendored
+399
-117
@@ -8,6 +8,14 @@
|
||||
|
||||
import * as stream from "stream";
|
||||
|
||||
export type TRet<T> = T | IPromise<T>;
|
||||
export type TFunc<T, R> = (value: T) => TRet<R>;
|
||||
|
||||
export interface IPromise<T> {
|
||||
catch<R>(onReject: TFunc<any, R>) : IPromise<R>;
|
||||
then<R>(onResolve?: TFunc<T, R>, onReject?: TFunc<any, R>) : IPromise<R>;
|
||||
}
|
||||
|
||||
export interface ILob {
|
||||
chunkSize: number;
|
||||
length: number;
|
||||
@@ -37,10 +45,21 @@ export interface ILob {
|
||||
|
||||
export interface Lob extends stream.Duplex {
|
||||
iLob: ILob;
|
||||
/** This corresponds to the size used by the Oracle LOB layer when accessing or modifying the LOB value. */
|
||||
chunkSize: number;
|
||||
/** Length of a queried LOB in bytes (for BLOBs) or characters (for CLOBs). */
|
||||
length: number;
|
||||
/**
|
||||
* he number of bytes (for BLOBs) or characters (for CLOBs) to read for each Stream 'data' event of a queried LOB.
|
||||
* The default value is chunkSize.
|
||||
* For efficiency, it is recommended that pieceSize be a multiple of chunkSize.
|
||||
* The maximum value for pieceSize is limited to the value of UINT_MAX.
|
||||
*/
|
||||
pieceSize: number;
|
||||
type: string;
|
||||
/**
|
||||
* This read-only attribute shows the type of Lob being used. It will have the value of one of the constants Oracledb.BLOB or Oracledb.CLOB. The value is derived from the bind type when using LOB bind variables, or from the column type when a LOB is returned by a query.
|
||||
*/
|
||||
type: number;
|
||||
|
||||
/**
|
||||
* Do not call this... used internally by node-oracledb
|
||||
@@ -73,119 +92,187 @@ export interface IPoolAttributes extends IConnectionAttributes {
|
||||
}
|
||||
|
||||
export interface IExecuteOptions {
|
||||
/** Maximum number of rows that will be retrieved. Used when resultSet is false. */
|
||||
maxRows?: number;
|
||||
/** Number of rows to be fetched in advance. */
|
||||
prefetchRows?: number;
|
||||
/** Result format - ARRAY o OBJECT */
|
||||
outFormat?: number;
|
||||
/** Should use ResultSet or not. */
|
||||
resultSet?: boolean;
|
||||
/** Transaction should auto commit after each statement? */
|
||||
/**
|
||||
* Transaction should auto commit after each statement?
|
||||
* Overrides Oracledb autoCommit.
|
||||
*/
|
||||
autoCommit?: boolean;
|
||||
/**
|
||||
* Determines whether additional metadata is available for queries and for REF CURSORs returned from PL/SQL blocks.
|
||||
* Overrides Oracledb extendedMetaData.
|
||||
*/
|
||||
extendedMetaData?: boolean;
|
||||
/**
|
||||
* Object defining how query column data should be represented in JavaScript.
|
||||
* The fetchInfo property can be used to indicate that number or date columns in a query should be returned as strings instead of their native format. The property can be used in conjunction with, or instead of, the global setting fetchAsString.
|
||||
* For example:
|
||||
*
|
||||
* fetchInfo:
|
||||
* {
|
||||
* "HIRE_DATE": { type : oracledb.STRING }, // return the date as a string
|
||||
* "COMMISSION_PCT": { type : oracledb.DEFAULT } // override Oracledb.fetchAsString
|
||||
* }
|
||||
*
|
||||
* Each column is specified by name, using Oracle's standard naming convention.
|
||||
* The valid values for type are STRING and DEFAULT. The former indicates that the given column should be returned as a string. The latter can be used to override any global mapping given by fetchAsString and allow the column data for this query to be returned in native format.
|
||||
* The maximum length of a string created by type mapping is 200 bytes. However, if a database column that is already of type STRING is specified in fetchInfo, then the actual database metadata will be used to determine the maximum length.
|
||||
* Columns fetched from REF CURSORS are not mapped by fetchInfo settings in the execute() call. Use the global fetchAsString instead.
|
||||
*/
|
||||
fetchInfo?: Object;
|
||||
/**
|
||||
* Maximum number of rows that will be retrieved. Used when resultSet is false.
|
||||
* Overrides Oracledb maxRows.
|
||||
*/
|
||||
maxRows?: number;
|
||||
/**
|
||||
* Result format - ARRAY o OBJECT
|
||||
* Overrides Oracledb outFormat.
|
||||
*/
|
||||
outFormat?: number;
|
||||
/**
|
||||
* Number of rows to be fetched in advance.
|
||||
* Overrides Oracledb prefetchRows.
|
||||
*/
|
||||
prefetchRows?: number;
|
||||
/**
|
||||
* Determines whether query results should be returned as a ResultSet object or directly. The default is false.
|
||||
*/
|
||||
resultSet?: boolean;
|
||||
}
|
||||
|
||||
export interface IExecuteReturn {
|
||||
/** Number o rows affected by the statement (used for inserts / updates)*/
|
||||
rowsAffected?: number;
|
||||
/** When the statement has out parameters, it comes here. */
|
||||
outBinds?: Array<any> | Object;
|
||||
/** Metadata information - just columns names for now. */
|
||||
/** Metadata information - column names is always given. If the Oracledb extendedMetaData or execute() option extendedMetaData are true then additional information is included. */
|
||||
metaData?: Array<IMetaData>;
|
||||
/** When not using ResultSet, query results comes here. */
|
||||
rows?: Array<Array<any>> | Array<any>;
|
||||
/** When using ResultSet, query results comes here. */
|
||||
/** This is either an array or an object containing OUT and IN OUT bind values. If bindParams is passed as an array, then outBinds is returned as an array. If bindParams is passed as an object, then outBinds is returned as an object. */
|
||||
outBinds?: Array<any> | Object;
|
||||
/** For SELECT statements when the resultSet option is true, use the resultSet object to fetch rows. See ResultSet Class. */
|
||||
resultSet?: IResultSet;
|
||||
/** For SELECT statements where the resultSet option is false or unspecified, rows contains an array of fetched rows. It will be NULL if there is an error or the SQL statement was not a SELECT statement. By default, the rows are in an array of column value arrays, but this can be changed to arrays of objects by setting outFormat to OBJECT. If a single row is fetched, then rows is an array that contains one single row. The number of rows returned is limited to the maxRows configuration property of the Oracledb object, although this may be overridden in any execute() call. */
|
||||
rows?: Array<Array<any>> | Array<any>;
|
||||
/** For DML statements (including SELECT FOR UPDATE) this contains the number of rows affected, for example the number of rows inserted. For non-DML statements such as queries, or if no rows are affected, then rowsAffected will be zero. */
|
||||
rowsAffected?: number;
|
||||
}
|
||||
|
||||
export interface IMetaData {
|
||||
/** Column name */
|
||||
/** The column name follows Oracle's standard name-casing rules. It will commonly be uppercase, since most applications create tables using unquoted, case-insensitive names. */
|
||||
name: string;
|
||||
/** one of the Node-oracledb Type Constant values. */
|
||||
fetchType?: number;
|
||||
/** one of the Node-oracledb Type Constant values. */
|
||||
dbType?: number;
|
||||
/** the database byte size. This is only set for DB_TYPE_VARCHAR, DB_TYPE_CHAR and DB_TYPE_RAW column types. */
|
||||
byteSize?: number;
|
||||
/** set only for DB_TYPE_NUMBER, DB_TYPE_TIMESTAMP, DB_TYPE_TIMESTAMP_TZ and DB_TYPE_TIMESTAMP_LTZ columns. */
|
||||
precision?: number;
|
||||
/** set only for DB_TYPE_NUMBER columns. */
|
||||
scale: number;
|
||||
/** indicates whether NULL values are permitted for this column. */
|
||||
nullable?: boolean;
|
||||
}
|
||||
|
||||
export interface IResultSet {
|
||||
/** Metadata information - just columns names for now. */
|
||||
metaData?: Array<IMetaData>;
|
||||
/**
|
||||
* Closes the ResultSet.
|
||||
* @param {(err:any)=>void} callback Callback called on finish or when some error occurs
|
||||
* Contains an array of objects with metadata about the query or REF CURSOR columns.
|
||||
* Each column's name is always given. If the Oracledb extendedMetaData or execute() option extendedMetaData are true then additional information is included.
|
||||
*/
|
||||
metaData?: Array<IMetaData>;
|
||||
|
||||
/**
|
||||
* Closes a ResultSet. Applications should always call this at the end of fetch or when no more rows are needed.
|
||||
* @param {(err:any)=>void} callback Callback called on finish or when some error occurs.
|
||||
* @returns void
|
||||
* @remarks After using a resultSet, it must be closed to free the resources used by the driver.
|
||||
* @remarks Applications should always call this at the end of fetch or when no more rows are needed.
|
||||
*/
|
||||
close(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Fetch one row from ResultSet.
|
||||
* Closes a ResultSet. Applications should always call this at the end of fetch or when no more rows are needed.
|
||||
* @returns A void Promise on finish or when some error occurs.
|
||||
* @remarks Applications should always call this at the end of fetch or when no more rows are needed.
|
||||
*/
|
||||
close(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* This call fetches one row of the result set as an object or an array of column values, depending on the value of outFormat.
|
||||
* At the end of fetching, the ResultSet should be freed by calling close().
|
||||
* @param {(err:any,row:Array<any>|Object)=>void} callback Callback called when the row is available or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
getRow(callback: (err: any, row: Array<any> | Object) => void): void;
|
||||
|
||||
/**
|
||||
* Fetch some rows from ResultSet.
|
||||
* @param {number} rowCount Number of rows to be fetched.
|
||||
* @param {(err:any,rows:Array<Array<any>>|Array<Object>)=>void} callback Callback called when the rows are available, or when some error occurs.
|
||||
* @returns void
|
||||
* @remarks When the number of rows passed to the callback is less than the rowCount, no more rows are available to be fetched.
|
||||
* This call fetches one row of the result set as an object or an array of column values, depending on the value of outFormat.
|
||||
* At the end of fetching, the ResultSet should be freed by calling close().
|
||||
* @returns Promise when the row is available or when some error occurs.
|
||||
*/
|
||||
getRows(rowCount: number, callback: (err: any, rows: Array<Array<any>> | Array<Object>) => void): void;
|
||||
getRow(): IPromise<Array<any> | Object>;
|
||||
|
||||
/**
|
||||
* This synchronous method converts a ResultSet into a stream.
|
||||
* It can be used to make ResultSets from top-level queries or from REF CURSOR bind variables streamable. To make top-level queries streamable, the alternative connection.queryStream() method may be easier to use.
|
||||
* @returns synchronous stream of result set.
|
||||
*/
|
||||
toQueryStream(): stream.Readable;
|
||||
}
|
||||
|
||||
export interface IConnection {
|
||||
/** Statement cache size in bytes (read-only)*/
|
||||
stmtCacheSize: number;
|
||||
/** Client id (to be sent to database) (write-only)*/
|
||||
clientId: string;
|
||||
/** Module (write-only) */
|
||||
module: string;
|
||||
/** Action */
|
||||
/**
|
||||
* The action attribute for end-to-end application tracing.
|
||||
* This is a write-only property. Displaying a Connection object will show a value of null for this attribute. See End-to-end Tracing, Mid-tier Authentication, and Auditing.
|
||||
*/
|
||||
action: string;
|
||||
/** Oracle server version */
|
||||
/**
|
||||
* The client identifier for end-to-end application tracing, use with mid-tier authentication, and with Virtual Private Databases.
|
||||
* This is a write-only property. Displaying a Connection object will show a value of null for this attribute. See End-to-end Tracing, Mid-tier Authentication, and Auditing.
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* The module attribute for end-to-end application tracing.
|
||||
* This is a write-only property. Displaying a Connection object will show a value of null for this attribute. See End-to-end Tracing, Mid-tier Authentication, and Auditing.
|
||||
*/
|
||||
module: string;
|
||||
/**
|
||||
* This readonly property gives a numeric representation of the Oracle database version. For version a.b.c.d.e, this property gives the number: (100000000 * a) + (1000000 * b) + (10000 * c) + (100 * d) + e
|
||||
*/
|
||||
oracleServerVersion: number;
|
||||
/**
|
||||
* The number of statements to be cached in the statement cache of the connection. The default value is the stmtCacheSize property in effect in the Pool object when the connection is created in the pool.
|
||||
*/
|
||||
stmtCacheSize: number;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} Binds Binds Object/Array
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
* This call stops the currently running operation on the connection.
|
||||
* If there is no operation in progress or the operation has completed by the time the break is issued, the break() is effectively a no-op.
|
||||
* If the running asynchronous operation is interrupted, its callback will return an error.
|
||||
* @param {(err: any) => void} callback Callback on break done.
|
||||
*/
|
||||
execute(sql: string,
|
||||
binds: Object | Array<any>,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
break(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} Binds Binds Object/Array
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
* This call stops the currently running operation on the connection.
|
||||
* If there is no operation in progress or the operation has completed by the time the break is issued, the break() is effectively a no-op.
|
||||
* If the running asynchronous operation is interrupted, its callback will return an error.
|
||||
* @returns A void promise when break is done.
|
||||
*/
|
||||
execute(sql: string,
|
||||
binds: Object | Array<any>,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
break(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
* Releases a connection. If the connection was obtained from the pool, the connection is returned to the pool and is available for reuse.
|
||||
* Note: calling close() when connections are no longer required is strongly encouraged. Releasing helps avoid resource leakage and can improve system efficiency.
|
||||
* When a connection is released, any ongoing transaction on the connection is rolled back.
|
||||
* After releasing a connection to a pool, there is no guarantee a subsequent getConnection() call gets back the same database connection. The application must redo any ALTER SESSION statements on the new connection object, as required.
|
||||
* @param {(err: any) => void} callback Callback on close done.
|
||||
*/
|
||||
execute(sql: string,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
close(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
* Releases a connection. If the connection was obtained from the pool, the connection is returned to the pool and is available for reuse.
|
||||
* Note: calling close() when connections are no longer required is strongly encouraged. Releasing helps avoid resource leakage and can improve system efficiency.
|
||||
* When a connection is released, any ongoing transaction on the connection is rolled back.
|
||||
* After releasing a connection to a pool, there is no guarantee a subsequent getConnection() call gets back the same database connection. The application must redo any ALTER SESSION statements on the new connection object, as required.
|
||||
* @returns A void Promise on close done.
|
||||
*/
|
||||
execute(sql: string,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* Release method on Connection class.
|
||||
* @param {(err: any) => void} callback Callback function to be called when the connection has been released.
|
||||
*/
|
||||
release(callback: (err: any) => void): void;
|
||||
close(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Send a commit requisition to the database.
|
||||
@@ -193,6 +280,99 @@ export interface IConnection {
|
||||
*/
|
||||
commit(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Send a commit requisition to the database.
|
||||
* @returns A void Promise on commit done.
|
||||
*/
|
||||
commit(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* This call executes a SQL or PL/SQL statement. See SQL Execution for examples.
|
||||
* The statement to be executed may contain IN binds, OUT or IN OUT bind values or variables, which are bound using either an object or an array.
|
||||
* A callback function returns a result object, containing any fetched rows, the values of any OUT and IN OUT bind variables, and the number of rows affected by the execution of DML statements.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} bindParams Binds Object/Array
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
bindParams: Object | Array<any>,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* This call executes a SQL or PL/SQL statement. See SQL Execution for examples.
|
||||
* The statement to be executed may contain IN binds, OUT or IN OUT bind values or variables, which are bound using either an object or an array.
|
||||
* A callback function returns a result object, containing any fetched rows, the values of any OUT and IN OUT bind variables, and the number of rows affected by the execution of DML statements.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} bindParams Binds Object/Array
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
bindParams: Object | Array<any>,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* This call executes a SQL or PL/SQL statement. See SQL Execution for examples.
|
||||
* The statement to be executed may contain IN binds, OUT or IN OUT bind values or variables, which are bound using either an object or an array.
|
||||
* A callback function returns a result object, containing any fetched rows, the values of any OUT and IN OUT bind variables, and the number of rows affected by the execution of DML statements.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* This call executes a SQL or PL/SQL statement. See SQL Execution for examples.
|
||||
* The statement to be executed may contain IN binds, OUT or IN OUT bind values or variables, which are bound using either an object or an array.
|
||||
* A callback function returns a result object, containing any fetched rows, the values of any OUT and IN OUT bind variables, and the number of rows affected by the execution of DML statements.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* This call executes a SQL or PL/SQL statement. See SQL Execution for examples.
|
||||
* The statement to be executed may contain IN binds, OUT or IN OUT bind values or variables, which are bound using either an object or an array.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} bindParams Binds Object/Array
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @returns A Promise of a result object, containing any fetched rows, the values of any OUT and IN OUT bind variables, and the number of rows affected by the execution of DML statements.
|
||||
*/
|
||||
execute(sql: string,
|
||||
bindParams?: Object | Array<any>,
|
||||
options?: IExecuteOptions): IPromise<IExecuteReturn>;
|
||||
|
||||
/**
|
||||
* This function provides query streaming support. The parameters are the same as execute() except a callback is not used. Instead this function returns a stream used to fetch data.
|
||||
* Each row is returned as a data event. Query metadata is available via a metadata event. The end event indicates the end of the query results.
|
||||
* Query results must be fetched to completion to avoid resource leaks.
|
||||
* The connection must remain open until the stream is completely read.
|
||||
* For tuning purposes the oracledb.maxRows property can be used to size an internal buffer used by queryStream(). Note it does not limit the number of rows returned by the stream. The oracledb.prefetchRows value will also affect performance.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} bindParams Binds Object/Array
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @returns Readable Stream for queries.
|
||||
*/
|
||||
queryStream(sql: string,
|
||||
bindParams?: Object | Array<any>,
|
||||
options?: IExecuteOptions): stream.Readable;
|
||||
|
||||
/**
|
||||
* An alias for Connection.close().
|
||||
* @param {(err: any) => void} callback Callback on close done.
|
||||
*/
|
||||
release(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* An alias for Connection.close().
|
||||
* @returns A void Promise on close done.
|
||||
*/
|
||||
release(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Send a rollback requisition to database.
|
||||
* @param {(err: any) => void} callback Callback on rollback done.
|
||||
@@ -200,34 +380,94 @@ export interface IConnection {
|
||||
rollback(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Send a break to the database.
|
||||
* @param {(err: any) => void} callback Callback on break done.
|
||||
* Send a rollback requisition to database.
|
||||
* @returns A void Promise on rollback done.
|
||||
*/
|
||||
break(callback: (err: any) => void): void;
|
||||
rollback(): IPromise<void>
|
||||
}
|
||||
|
||||
export interface IConnectionPool {
|
||||
poolMax: number;
|
||||
poolMin: number;
|
||||
poolIncrement: number;
|
||||
poolTimeout: number;
|
||||
connectionsOpen: number;
|
||||
/**
|
||||
* The number of currently active connections in the connection pool i.e. the number of connections currently checked-out using getConnection().
|
||||
*/
|
||||
connectionsInUse: number;
|
||||
/**
|
||||
* The number of currently open connections in the underlying connection pool.
|
||||
*/
|
||||
connectionsOpen: number;
|
||||
/**
|
||||
* The number of connections that are opened whenever a connection request exceeds the number of currently open connections.
|
||||
*/
|
||||
poolIncrement: number;
|
||||
/**
|
||||
* The maximum number of connections that can be open in the connection pool.
|
||||
*/
|
||||
poolMax: number;
|
||||
/**
|
||||
* The minimum number of connections a connection pool maintains, even when there is no activity to the target database.
|
||||
*/
|
||||
poolMin: number;
|
||||
/**
|
||||
* The time (in seconds) after which the pool terminates idle connections (unused in the pool). The number of connections does not drop below poolMin.
|
||||
*/
|
||||
poolTimeout: number;
|
||||
/**
|
||||
* Determines whether requests for connections from the pool are queued when the number of connections "checked out" from the pool has reached the maximum number specified by poolMax.
|
||||
*/
|
||||
queueRequests: number;
|
||||
/**
|
||||
* The time (in milliseconds) that a connection request should wait in the queue before the request is terminated.
|
||||
*/
|
||||
queueTimeout: number;
|
||||
/**
|
||||
* The number of statements to be cached in the statement cache of each connection.
|
||||
*/
|
||||
stmtCacheSize: number;
|
||||
|
||||
/**
|
||||
* Finalizes the connection pool.
|
||||
* @param {(err:any)=>void} callback Callback called when the pool is terminated or when some error occurs
|
||||
* @returns void
|
||||
*/
|
||||
terminate(callback: (err: any) => void): void;
|
||||
close(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Retrieve a connection from the pool.
|
||||
* Finalizes the connection pool.
|
||||
* @returns Promise to when the close finishes.
|
||||
*/
|
||||
close(): IPromise<void>;
|
||||
|
||||
/**
|
||||
* This method obtains a connection from the connection pool.
|
||||
* If a previously opened connection is available in the pool, that connection is returned. If all connections in the pool are in use, a new connection is created and returned to the caller, as long as the number of connections does not exceed the specified maximum for the pool. If the pool is at its maximum limit, the getConnection() call results in an error, such as ORA-24418: Cannot open further sessions.
|
||||
* @param {(err:any,connection:IConnection)=>void} callback Callback called when the connection is available or when some error occurs.
|
||||
* @returns void
|
||||
* @see {@link https://jsao.io/2015/03/making-a-wrapper-module-for-the-node-js-driver-for-oracle-database/}
|
||||
* @see {@link https://github.com/OraOpenSource/orawrap}
|
||||
*/
|
||||
getConnection(callback: (err: any, connection: IConnection) => void): void;
|
||||
|
||||
/**
|
||||
* This method obtains a connection from the connection pool.
|
||||
* If a previously opened connection is available in the pool, that connection is returned. If all connections in the pool are in use, a new connection is created and returned to the caller, as long as the number of connections does not exceed the specified maximum for the pool. If the pool is at its maximum limit, the getConnection() call results in an error, such as ORA-24418: Cannot open further sessions.
|
||||
* @returns An IConnection Promise to when the connection is available or when some error occurs.
|
||||
* @see {@link https://jsao.io/2015/03/making-a-wrapper-module-for-the-node-js-driver-for-oracle-database/}
|
||||
* @see {@link https://github.com/OraOpenSource/orawrap}
|
||||
*/
|
||||
getConnection(): IPromise<IConnection>;
|
||||
|
||||
/**
|
||||
* An alias for IConnectionPool.close().
|
||||
* @param {(err:any)=>void} callback Callback called when the pool is terminated or when some error occurs
|
||||
* @returns void
|
||||
*/
|
||||
terminate(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* An alias for IConnectionPool.close().
|
||||
* @returns Promise to when the close finishes.
|
||||
*/
|
||||
terminate(): IPromise<void>;
|
||||
}
|
||||
|
||||
export declare const DEFAULT: number;
|
||||
@@ -261,13 +501,62 @@ export declare const OBJECT: number;
|
||||
*/
|
||||
export declare function newLob(iLob: ILob): Lob;
|
||||
|
||||
/** Default transaction behaviour of auto commit for each statement. */
|
||||
export var autoCommit: boolean;
|
||||
/**
|
||||
* Creates a connection with the database.
|
||||
* @param {IConnectionAttributes} connectionAttributes Parameters to stablish the connection.
|
||||
* @param {(err:any,connection:IConnection)=>void} callback Callback to run when the connection gets stablished or when some error occurs.
|
||||
* @returns void
|
||||
* The user-chosen Connection class value defines a logical name for connections. Most single purpose applications should set connectionClass when using a connection pool or DRCP.
|
||||
* When a pooled session has a connection class, Oracle ensures that the session is not shared outside of that connection class.
|
||||
*/
|
||||
export declare function getConnection(connectionAttributes: IConnectionAttributes, callback: (err: any, connection: IConnection) => void): void;
|
||||
export var connectionClass: string;
|
||||
/**
|
||||
* Determines whether additional metadata is available for queries and for REF CURSORs returned from PL/SQL blocks.
|
||||
* The default value for extendedMetaData is false. With this value, the result.metaData result.resultSet.metaData objects only include column names.
|
||||
*/
|
||||
export var extendedMetaData: boolean;
|
||||
/** Default authentication/authorization method. When true, the SO trusted user will be used. */
|
||||
export var externalAuth: boolean;
|
||||
/**
|
||||
* An array of node-oracledb types. When any column having the specified type is queried with execute(), the column data is returned as a string instead of the native representation. For column types not specified in fetchAsString, native types will be returned.
|
||||
* By default all columns are returned as native types.
|
||||
*/
|
||||
export var fetchAsString: Array<number>;
|
||||
/** Default size in bytes that the driver will fetch from LOBs in advance. */
|
||||
export var lobPrefetchSize: number;
|
||||
/** Default maximum number of rows to be fetched in statements not using ResultSets */
|
||||
export var maxRows: number;
|
||||
/** Version of OCI that is used. */
|
||||
export var oracleClientVersion: number;
|
||||
/** Default format for returning rows. When ARRAY, it will return Array<Array<any>>. When OBJECT, it will return Array<Object>. */
|
||||
export var outFormat: number;
|
||||
/** Default number of connections to increment when available connections reach 0 in created pools. poolMax will be respected.*/
|
||||
export var poolIncrement: number;
|
||||
/** Default maximum connections in created pools */
|
||||
export var poolMax: number;
|
||||
/** Default minimum connections in created pools */
|
||||
export var poolMin: number;
|
||||
/** Default timeout for unused connections in pool to be released. poolMin will be respected.*/
|
||||
export var poolTimeout: number;
|
||||
/** Default number of rows that the driver will fetch in each query.*/
|
||||
export var prefetchRows: number;
|
||||
/**
|
||||
* Node-oracledb supports Promises on all methods. The standard Promise library is used in Node 0.12 and greater. Promise support is not enabled by default in Node 0.10.
|
||||
*/
|
||||
export var Promise: any;
|
||||
/**
|
||||
* If this property is true and the number of connections "checked out" from the pool has reached the number specified by poolMax, then new requests for connections are queued until in-use connections are released.
|
||||
* If this property is false and a request for a connection is made from a pool where the number of "checked out" connections has reached poolMax, then an ORA-24418 error indicating that further sessions cannot be opened will be returned.
|
||||
* The default value is true.
|
||||
*/
|
||||
export var queueRequests: boolean;
|
||||
/**
|
||||
* The number of milliseconds after which connection requests waiting in the connection request queue are terminated. If queueTimeout is 0, then queued connection requests are never terminated.
|
||||
* The default value is 60000.
|
||||
*/
|
||||
export var queueTimeout: number;
|
||||
/** Default size of statements cache. Used to speed up creating queries.*/
|
||||
export var stmtCacheSize: number;
|
||||
/** node-oracledb driver version. */
|
||||
export var version: number;
|
||||
|
||||
/**
|
||||
* Creates a database managed connection pool.
|
||||
@@ -275,33 +564,26 @@ export declare function getConnection(connectionAttributes: IConnectionAttribute
|
||||
* @param {(err:any,connection:IConnectionPool)=>void} callback Callback to run when the connection pool gets created or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
export declare function createPool(poolAttributes: IPoolAttributes, callback: (err: any, connection: IConnectionPool) => void): void;
|
||||
export function createPool(poolAttributes: IPoolAttributes, callback: (err: any, connection: IConnectionPool) => void): void;
|
||||
|
||||
/** Default maximum connections in created pools */
|
||||
export declare var poolMax: number;
|
||||
/** Default minimum connections in created pools */
|
||||
export declare var poolMin: number;
|
||||
/** Default number of connections to increment when available connections reach 0 in created pools. poolMax will be respected.*/
|
||||
export declare var poolIncrement: number;
|
||||
/** Default timeout for unused connections in pool to be released. poolMin will be respected.*/
|
||||
export declare var poolTimeout: number;
|
||||
/** Default size of statements cache. Used to speed up creating queries.*/
|
||||
export declare var stmtCacheSize: number;
|
||||
/** Default number of rows that the driver will fetch in each query.*/
|
||||
export declare var prefetchRows: number;
|
||||
/** Default transaction behaviour of auto commit for each statement. */
|
||||
export declare var autoCommit: boolean;
|
||||
/** Default maximum number of rows to be fetched in statements not using ResultSets */
|
||||
export declare var maxRows: number;
|
||||
/** Default format for returning rows. When ARRAY, it will return Array<Array<any>>. When OBJECT, it will return Array<Object>. */
|
||||
export declare var outFormat: number;
|
||||
/** node-oracledb driver version. */
|
||||
export declare var version: number;
|
||||
export declare var connectionClass: string;
|
||||
/** Default authentication/authorization method. When true, the SO trusted user will be used. */
|
||||
export declare var externalAuth: boolean;
|
||||
export declare var fetchAsString: any;
|
||||
/** Default size in bytes that the driver will fetch from LOBs in advance. */
|
||||
export declare var lobPrefetchSize: number;
|
||||
/** Version of OCI that is used. */
|
||||
export declare var oracleClientVersion: number;
|
||||
/**
|
||||
* Creates a database managed connection pool.
|
||||
* @param {IPoolAttributes} poolAttributes Parameters to stablish the connection pool.
|
||||
* @returns Promise {(connection:IConnectionPool)=>any} Promise with the connection pool.
|
||||
*/
|
||||
export function createPool(poolAttributes: IPoolAttributes): IPromise< IConnectionPool >;
|
||||
|
||||
/**
|
||||
* Creates a connection with the database.
|
||||
* @param {IConnectionAttributes} connectionAttributes Parameters to stablish the connection.
|
||||
* @param {(err:any,connection:IConnection)=>void} callback Callback to run when the connection gets stablished or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
export function getConnection(connectionAttributes: IConnectionAttributes, callback: (err: any, connection: IConnection) => void): void;
|
||||
|
||||
/**
|
||||
* Creates a connection with the database.
|
||||
* @param {IConnectionAttributes} connectionAttributes Parameters to stablish the connection.
|
||||
* @returns {(connection:IConnection)=>any} Promise with the connection.
|
||||
*/
|
||||
export function getConnection(connectionAttributes: IConnectionAttributes): IPromise< IConnection >;
|
||||
@@ -0,0 +1,32 @@
|
||||
/// <reference path="oracledb-1.5.0.d.ts" />
|
||||
|
||||
import * as OracleDB from 'oracledb'
|
||||
|
||||
OracleDB.getConnection(
|
||||
{
|
||||
user: "hr",
|
||||
password: "welcome",
|
||||
connectString: "localhost/XE"
|
||||
},
|
||||
function(err, connection) {
|
||||
if (err) {
|
||||
console.error(err.message)
|
||||
return
|
||||
}
|
||||
connection.execute(
|
||||
"SELECT department_id, department_name " +
|
||||
"FROM departments " +
|
||||
"WHERE manager_id < :id",
|
||||
[110], // bind value for :id
|
||||
function (err, result) {
|
||||
if (err) {
|
||||
console.error(err.message)
|
||||
return
|
||||
}
|
||||
console.log(result.rows);
|
||||
console.log(result.rows[0].department_id); // when outFormet is OBJECT
|
||||
console.log(result.metaData[0].name);
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
Vendored
+308
@@ -0,0 +1,308 @@
|
||||
// Type definitions for oracledb v1.5.0
|
||||
// Project: https://github.com/oracle/node-oracledb
|
||||
// Definitions by: Richard Natal <https://github.com/Bigous>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'oracledb' {
|
||||
import * as stream from "stream";
|
||||
|
||||
export interface ILob {
|
||||
chunkSize: number;
|
||||
length: number;
|
||||
pieceSize: number;
|
||||
offset?: number;
|
||||
type: string;
|
||||
/**
|
||||
* Release method on ILob class.
|
||||
* @remarks The cleanup() called by Release() only frees OCI error handle and Lob
|
||||
* locator. These calls acquire mutex on OCI environment handle very briefly.
|
||||
*/
|
||||
release?(): void;
|
||||
/**
|
||||
* Read method on ILob class.
|
||||
* @param {(err : any, chunk: string | Buffer) => void} callback Callback to recive the data from lob.
|
||||
* @remarks CLobs send strings while BLobs send Buffer object.
|
||||
*/
|
||||
read?(callback: (err: any, chunk: string | Buffer) => void): void;
|
||||
/**
|
||||
* Read method on ILob class.
|
||||
* @param {Buffer} data Data write into Lob.
|
||||
* @param {(err: any) => void} callback Callback executed when writ is finished or when some error occured.
|
||||
* @remarks CLobs send strings while BLobs send Buffer object.
|
||||
*/
|
||||
write?(data: Buffer, callback: (err: any) => void): void;
|
||||
}
|
||||
|
||||
export interface Lob extends stream.Duplex {
|
||||
iLob: ILob;
|
||||
chunkSize: number;
|
||||
length: number;
|
||||
pieceSize: number;
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* Do not call this... used internally by node-oracledb
|
||||
*/
|
||||
constructor(iLob: ILob, opts: stream.DuplexOptions): Lob;
|
||||
constructor(iLob: ILob): Lob;
|
||||
|
||||
/**
|
||||
* Closes the current LOB.
|
||||
* @param {(err: any) => void} callback? When passed, is called after the release.
|
||||
* @returns void
|
||||
*/
|
||||
close(callback: (err: any) => void): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export interface IConnectionAttributes {
|
||||
user?: string;
|
||||
password?: string;
|
||||
connectString: string;
|
||||
stmtCacheSize?: number;
|
||||
externalAuth?: boolean;
|
||||
}
|
||||
|
||||
export interface IPoolAttributes extends IConnectionAttributes {
|
||||
poolMax?: number;
|
||||
poolMin?: number;
|
||||
poolIncrement?: number;
|
||||
poolTimeout?: number;
|
||||
}
|
||||
|
||||
export interface IExecuteOptions {
|
||||
/** Maximum number of rows that will be retrieved. Used when resultSet is false. */
|
||||
maxRows?: number;
|
||||
/** Number of rows to be fetched in advance. */
|
||||
prefetchRows?: number;
|
||||
/** Result format - ARRAY o OBJECT */
|
||||
outFormat?: number;
|
||||
/** Should use ResultSet or not. */
|
||||
resultSet?: boolean;
|
||||
/** Transaction should auto commit after each statement? */
|
||||
autoCommit?: boolean;
|
||||
}
|
||||
|
||||
export interface IExecuteReturn {
|
||||
/** Number o rows affected by the statement (used for inserts / updates)*/
|
||||
rowsAffected?: number;
|
||||
/** When the statement has out parameters, it comes here. */
|
||||
outBinds?: Array<any> | Object;
|
||||
/** Metadata information - just columns names for now. */
|
||||
metaData?: Array<IMetaData>;
|
||||
/** When not using ResultSet, query results comes here. */
|
||||
rows?: Array<Array<any>> | Array<any>;
|
||||
/** When using ResultSet, query results comes here. */
|
||||
resultSet?: IResultSet;
|
||||
}
|
||||
|
||||
export interface IMetaData {
|
||||
/** Column name */
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface IResultSet {
|
||||
/** Metadata information - just columns names for now. */
|
||||
metaData?: Array<IMetaData>;
|
||||
/**
|
||||
* Closes the ResultSet.
|
||||
* @param {(err:any)=>void} callback Callback called on finish or when some error occurs
|
||||
* @returns void
|
||||
* @remarks After using a resultSet, it must be closed to free the resources used by the driver.
|
||||
*/
|
||||
close(callback: (err: any) => void): void;
|
||||
/**
|
||||
* Fetch one row from ResultSet.
|
||||
* @param {(err:any,row:Array<any>|Object)=>void} callback Callback called when the row is available or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
getRow(callback: (err: any, row: Array<any> | Object) => void): void;
|
||||
/**
|
||||
* Fetch some rows from ResultSet.
|
||||
* @param {number} rowCount Number of rows to be fetched.
|
||||
* @param {(err:any,rows:Array<Array<any>>|Array<Object>)=>void} callback Callback called when the rows are available, or when some error occurs.
|
||||
* @returns void
|
||||
* @remarks When the number of rows passed to the callback is less than the rowCount, no more rows are available to be fetched.
|
||||
*/
|
||||
getRows(rowCount: number, callback: (err: any, rows: Array<Array<any>> | Array<Object>) => void): void;
|
||||
}
|
||||
|
||||
export interface IConnection {
|
||||
/** Statement cache size in bytes (read-only)*/
|
||||
stmtCacheSize: number;
|
||||
/** Client id (to be sent to database) (write-only)*/
|
||||
clientId: string;
|
||||
/** Module (write-only) */
|
||||
module: string;
|
||||
/** Action */
|
||||
action: string;
|
||||
/** Oracle server version */
|
||||
oracleServerVersion: number;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} Binds Binds Object/Array
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
binds: Object | Array<any>,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {Object|Array<any>} Binds Binds Object/Array
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
binds: Object | Array<any>,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {IExecuteOptions} options Options object
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
options: IExecuteOptions,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* Execute method on Connection class.
|
||||
* @param {string} sql SQL Statement.
|
||||
* @param {(err: any, value: IExecuteReturn) => void} callback Callback function to receive the result.
|
||||
*/
|
||||
execute(sql: string,
|
||||
callback: (err: any, value: IExecuteReturn) => void): void;
|
||||
|
||||
/**
|
||||
* Release method on Connection class.
|
||||
* @param {(err: any) => void} callback Callback function to be called when the connection has been released.
|
||||
*/
|
||||
release(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Send a commit requisition to the database.
|
||||
* @param {(err: any) => void} callback Callback on commit done.
|
||||
*/
|
||||
commit(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Send a rollback requisition to database.
|
||||
* @param {(err: any) => void} callback Callback on rollback done.
|
||||
*/
|
||||
rollback(callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* Send a break to the database.
|
||||
* @param {(err: any) => void} callback Callback on break done.
|
||||
*/
|
||||
break(callback: (err: any) => void): void;
|
||||
}
|
||||
|
||||
export interface IConnectionPool {
|
||||
poolMax: number;
|
||||
poolMin: number;
|
||||
poolIncrement: number;
|
||||
poolTimeout: number;
|
||||
connectionsOpen: number;
|
||||
connectionsInUse: number;
|
||||
stmtCacheSize: number;
|
||||
/**
|
||||
* Finalizes the connection pool.
|
||||
* @param {(err:any)=>void} callback Callback called when the pool is terminated or when some error occurs
|
||||
* @returns void
|
||||
*/
|
||||
terminate(callback: (err: any) => void): void;
|
||||
/**
|
||||
* Retrieve a connection from the pool.
|
||||
* @param {(err:any,connection:IConnection)=>void} callback Callback called when the connection is available or when some error occurs.
|
||||
* @returns void
|
||||
* @see {@link https://jsao.io/2015/03/making-a-wrapper-module-for-the-node-js-driver-for-oracle-database/}
|
||||
* @see {@link https://github.com/OraOpenSource/orawrap}
|
||||
*/
|
||||
getConnection(callback: (err: any, connection: IConnection) => void): void;
|
||||
}
|
||||
|
||||
export const DEFAULT: number;
|
||||
/** Data type */
|
||||
export const STRING: number;
|
||||
/** Data type */
|
||||
export const NUMBER: number;
|
||||
/** Data type */
|
||||
export const DATE: number;
|
||||
/** Data type */
|
||||
export const CURSOR: number;
|
||||
/** Data type */
|
||||
export const BUFFER: number;
|
||||
/** Data type */
|
||||
export const CLOB: number;
|
||||
/** Data type */
|
||||
export const BLOB: number;
|
||||
/** Bind direction */
|
||||
export const BIND_IN: number;
|
||||
/** Bind direction */
|
||||
export const BIND_INOUT: number;
|
||||
/** Bind direction */
|
||||
export const BIND_OUT: number;
|
||||
/** outFormat */
|
||||
export const ARRAY: number;
|
||||
/** outFormat */
|
||||
export const OBJECT: number;
|
||||
|
||||
/**
|
||||
* Do not use this method - used internally by node-oracledb.
|
||||
*/
|
||||
export function newLob(iLob: ILob): Lob;
|
||||
|
||||
/**
|
||||
* Creates a connection with the database.
|
||||
* @param {IConnectionAttributes} connectionAttributes Parameters to stablish the connection.
|
||||
* @param {(err:any,connection:IConnection)=>void} callback Callback to run when the connection gets stablished or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
export function getConnection(connectionAttributes: IConnectionAttributes, callback: (err: any, connection: IConnection) => void): void;
|
||||
|
||||
/**
|
||||
* Creates a database managed connection pool.
|
||||
* @param {IPoolAttributes} poolAttributes Parameters to stablish the connection pool.
|
||||
* @param {(err:any,connection:IConnectionPool)=>void} callback Callback to run when the connection pool gets created or when some error occurs.
|
||||
* @returns void
|
||||
*/
|
||||
export function createPool(poolAttributes: IPoolAttributes, callback: (err: any, connection: IConnectionPool) => void): void;
|
||||
|
||||
/** Default maximum connections in created pools */
|
||||
export var poolMax: number;
|
||||
/** Default minimum connections in created pools */
|
||||
export var poolMin: number;
|
||||
/** Default number of connections to increment when available connections reach 0 in created pools. poolMax will be respected.*/
|
||||
export var poolIncrement: number;
|
||||
/** Default timeout for unused connections in pool to be released. poolMin will be respected.*/
|
||||
export var poolTimeout: number;
|
||||
/** Default size of statements cache. Used to speed up creating queries.*/
|
||||
export var stmtCacheSize: number;
|
||||
/** Default number of rows that the driver will fetch in each query.*/
|
||||
export var prefetchRows: number;
|
||||
/** Default transaction behaviour of auto commit for each statement. */
|
||||
export var autoCommit: boolean;
|
||||
/** Default maximum number of rows to be fetched in statements not using ResultSets */
|
||||
export var maxRows: number;
|
||||
/** Default format for returning rows. When ARRAY, it will return Array<Array<any>>. When OBJECT, it will return Array<Object>. */
|
||||
export var outFormat: number;
|
||||
/** node-oracledb driver version. */
|
||||
export var version: number;
|
||||
export var connectionClass: string;
|
||||
/** Default authentication/authorization method. When true, the SO trusted user will be used. */
|
||||
export var externalAuth: boolean;
|
||||
export var fetchAsString: any;
|
||||
/** Default size in bytes that the driver will fetch from LOBs in advance. */
|
||||
export var lobPrefetchSize: number;
|
||||
/** Version of OCI that is used. */
|
||||
export var oracleClientVersion: number;
|
||||
}
|
||||
@@ -20,12 +20,39 @@ OracleDB.getConnection(
|
||||
[110], // bind value for :id
|
||||
function(err, result) {
|
||||
if (err) {
|
||||
console.error(err.message); return;
|
||||
console.error(err.message);
|
||||
} else {
|
||||
console.log(result.rows);
|
||||
console.log(result.rows[0].department_id); // when outFormet is OBJECT
|
||||
console.log(result.metaData[0].name);
|
||||
}
|
||||
console.log(result.rows);
|
||||
console.log(result.rows[0].department_id); // when outFormet is OBJECT
|
||||
console.log(result.metaData[0].name);
|
||||
connection.release();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
OracleDB.getConnection(
|
||||
{
|
||||
user: "hr",
|
||||
password: "welcome",
|
||||
connectString: "localhost/XE"
|
||||
}
|
||||
).then((connection: OracleDB.IConnection) => {
|
||||
return connection.execute(
|
||||
"SELECT department_id, department_name " +
|
||||
"FROM departments " +
|
||||
"WHERE manager_id < :id",
|
||||
[110]
|
||||
).then(result => {
|
||||
console.log(result.rows);
|
||||
console.log(result.rows[0].department_id); // when outFormet is OBJECT
|
||||
console.log(result.metaData[0].name);
|
||||
}).catch((err: any) => {
|
||||
console.error(err.message);
|
||||
}).then(() => {
|
||||
return connection.release();
|
||||
});
|
||||
}).catch((err: any) => {
|
||||
console.error(err.message);
|
||||
});
|
||||
|
||||
Vendored
+49
-18
@@ -1,8 +1,9 @@
|
||||
// Type definitions for ProtoBuf.js
|
||||
// Type definitions for ProtoBuf.js 5.0.1
|
||||
// Project: https://github.com/dcodeIO/ProtoBuf.js
|
||||
// Definitions by: Panu Horsmalahti <https://github.com/panuhorsmalahti>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="bytebuffer" />
|
||||
/// <reference types="node" />
|
||||
|
||||
declare namespace ProtoBuf {
|
||||
@@ -10,25 +11,24 @@ declare namespace ProtoBuf {
|
||||
// protobufjs/src/ProtoBuf.js
|
||||
|
||||
var Builder: Builder;
|
||||
var ByteBuffer: Buffer;
|
||||
var Long: LongStatic;
|
||||
var DotProto: DotProto;
|
||||
var Reflect: Reflect;
|
||||
var Util: Util;
|
||||
|
||||
// var Lang: Lang; TODO: implement interface Lang
|
||||
// var Util: Util; TODO: implement interface Util
|
||||
|
||||
export function loadJson(json: string, builder?: ProtoBuilder,
|
||||
filename?: string): ProtoBuilder;
|
||||
export function loadJson(json: string, builder?: ProtoBuilder | string | {},
|
||||
filename?: string | {}): ProtoBuilder;
|
||||
|
||||
export function loadJsonFile(filename: string,
|
||||
export function loadJsonFile(filename: string | {},
|
||||
callback?: (error: any, builder: ProtoBuilder) => void,
|
||||
builder?: ProtoBuilder): ProtoBuilder;
|
||||
|
||||
export function loadProto(proto: string, builder?: ProtoBuilder,
|
||||
filename?: string): ProtoBuilder;
|
||||
export function loadProto(proto: string, builder?: ProtoBuilder | string | {},
|
||||
filename?: string | {}): ProtoBuilder;
|
||||
|
||||
export function loadProtoFile(filePath: string,
|
||||
export function loadProtoFile(filePath: string | {},
|
||||
callback?: (error: any, builder: ProtoBuilder) => void,
|
||||
builder?: ProtoBuilder): ProtoBuilder;
|
||||
|
||||
@@ -117,6 +117,26 @@ declare namespace ProtoBuf {
|
||||
*/
|
||||
export interface Message {
|
||||
new(values?: {[key: string]: any}, var_args?: string[]): Message;
|
||||
$add(key: string, value: any, noAssert?: boolean): Message;
|
||||
$get<T>(key: string): T;
|
||||
$set(key: string | {[key: string]: any}, value?: any | boolean, noAssert?: boolean): void;
|
||||
add(key: string, value: any, noAssert?: boolean): Message;
|
||||
calculate(): number;
|
||||
encode(buffer?: ByteBuffer | boolean, noVerify?: boolean): ByteBuffer;
|
||||
encode64(): string;
|
||||
encodeAB(): ArrayBuffer;
|
||||
encodeNB(): Buffer;
|
||||
encodeHex(): string;
|
||||
encodeJSON(): string;
|
||||
encodeDelimited(buffer?: ByteBuffer | boolean, noVerify?: boolean): ByteBuffer;
|
||||
get<T>(key: string, noAssert?: boolean): T;
|
||||
set(key: string | {[key: string]: any}, value?: any | boolean, noAssert?: boolean): void;
|
||||
toArrayBuffer(): ArrayBuffer;
|
||||
toBase64(): string;
|
||||
toBuffer(): Buffer;
|
||||
toHex(): string;
|
||||
toRaw(binaryAsBase64?: boolean, longsAsStrings?: boolean): {[key: string]: any};
|
||||
toString(): string;
|
||||
[field: string]: any;
|
||||
}
|
||||
|
||||
@@ -149,15 +169,16 @@ declare namespace ProtoBuf {
|
||||
}
|
||||
|
||||
export interface ProtoBuf {
|
||||
[package: string]: {[key: string]: MetaMessage | any};
|
||||
[package: string]: {[key: string]: MetaMessage<Message> | any};
|
||||
}
|
||||
|
||||
export interface MetaMessage {
|
||||
new(values?: {[key: string]: any}, var_args?: string[]): Message;
|
||||
decode(buffer?: Buffer, enc?: string): Message;
|
||||
decodeDelimited(buffer?: Buffer, enc?: string): Message;
|
||||
decode64(str: string): Message;
|
||||
decodeHex(str: string): Message;
|
||||
export interface MetaMessage<T> {
|
||||
new(values?: {[key: string]: any}, var_args?: string[]): T & Message;
|
||||
decode(buffer: ArrayBuffer | ByteBuffer | Buffer | string, length?: number | string, enc?: string): T & Message;
|
||||
decodeDelimited(buffer: ByteBuffer | ArrayBuffer | Buffer | string, enc?: string): T & Message;
|
||||
decode64(str: string): T & Message;
|
||||
decodeHex(str: string): T & Message;
|
||||
decodeJSON(str: string): T & Message;
|
||||
}
|
||||
|
||||
// ==========
|
||||
@@ -242,6 +263,15 @@ declare namespace ProtoBuf {
|
||||
options: {[key: string]: any};
|
||||
}
|
||||
|
||||
// ==========
|
||||
// protobufjs/src/ProtoBuf/Util.js
|
||||
|
||||
export interface Util {
|
||||
IS_NODE: boolean
|
||||
fetch(path: string, callback?: (data: string) => any): string;
|
||||
toCamelCase(str: string): string;
|
||||
XHR(): XMLHttpRequest;
|
||||
}
|
||||
|
||||
// ==========
|
||||
// protobufjs/src/ProtoBuf/Reflect.js
|
||||
@@ -288,9 +318,10 @@ declare namespace ProtoBuf {
|
||||
// new ProtoBuf.Reflect.Message.ExtensionField();
|
||||
OneOf: ReflectOneOf; // NOTE: only for new ProtoBuf.Reflect.Message.OneOf();
|
||||
extensions: number[];
|
||||
clazz(): MetaMessage;
|
||||
clazz(): MetaMessage<Message>;
|
||||
isGroup: boolean;
|
||||
build(rebuild?: boolean): MetaMessage|any;
|
||||
build(rebuild?: boolean): MetaMessage<Message>|any;
|
||||
build<T>(rebuild?: boolean): MetaMessage<T>|any;
|
||||
encode(message: Message, buffer: Buffer, noVerify?: boolean): Buffer;
|
||||
calculate(message: Message): number;
|
||||
decode(buffer: Buffer, length?: number, expectedGroupEndId?: number): Message;
|
||||
|
||||
@@ -44,7 +44,7 @@ function testProtoBufJs() {
|
||||
assertIsNamespace(protoFile.ns, "protoFile.ns");
|
||||
assertIsNamespace(protoFile.ptr, "protoFile.ptr");
|
||||
|
||||
assertIsProtoBuf(protoFile.build(), "protoFile.build()");
|
||||
assertIsMetaMessage<any>(protoFile.build(), "protoFile.build()");
|
||||
assertIsProtoBuf(protoFile.result, "protoFile.result");
|
||||
|
||||
assertIsProtoBuilder(protoFile.create(), "protoFile.create()");
|
||||
@@ -117,11 +117,12 @@ function assertIsProtoBuf(pb: ProtoBuf.ProtoBuf, name: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function assertIsMetaMessage(mm: ProtoBuf.MetaMessage, name: string) {
|
||||
function assertIsMetaMessage<T>(mm: ProtoBuf.MetaMessage<T>, name: string) {
|
||||
assert.ok("decode" in mm, name + " should contain property decode");
|
||||
assert.ok("decodeDelimited" in mm, name + " should contain property decodeDelimited");
|
||||
assert.ok("decode64" in mm, name + " should contain property decode64");
|
||||
assert.ok("decodeHex" in mm, name + " should contain property decodeHex");
|
||||
assert.ok("decodeJSON" in mm, name + " should contain property decodeJSON");
|
||||
}
|
||||
|
||||
function assertIsDotProto(dp: ProtoBuf.DotProto, name: string) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
///<reference path="../react/react.d.ts" />
|
||||
///<reference path="./react-file-input.d.ts" />
|
||||
|
||||
import * as React from "react";
|
||||
import FileInput = require('react-file-input');
|
||||
|
||||
class Form extends React.Component<{}, {}> {
|
||||
handleChange = (event: React.SyntheticEvent) => {
|
||||
const target: any = event.target;
|
||||
console.log('Selected file:', target.files[0]);
|
||||
}
|
||||
|
||||
render(): React.ReactElement<{}> {
|
||||
return (
|
||||
<form>
|
||||
<FileInput
|
||||
name="myImage"
|
||||
accept=".png,.gif"
|
||||
placeholder="My Image"
|
||||
className="inputClass"
|
||||
disabled={false}
|
||||
onChange={this.handleChange}
|
||||
/>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for react-file-input
|
||||
// Project: https://www.npmjs.com/package/react-file-input
|
||||
// Definitions by: Dmitry Rogozhny <https://github.com/dmitryrogozhny>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../react/react.d.ts" />
|
||||
|
||||
declare module "react-file-input" {
|
||||
import React = __React;
|
||||
|
||||
interface FileInputProps {
|
||||
name: string;
|
||||
className: string;
|
||||
accept: string;
|
||||
placeholder: string;
|
||||
disabled?: boolean;
|
||||
onChange: (event: React.SyntheticEvent) => void;
|
||||
}
|
||||
|
||||
class FileInput extends React.Component<FileInputProps, {}> {
|
||||
}
|
||||
|
||||
export = FileInput;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
///<reference path="../react/react.d.ts" />
|
||||
///<reference path="./react-file-reader-input.d.ts" />
|
||||
|
||||
import * as React from "react";
|
||||
import FileReaderInput = require("react-file-reader-input");
|
||||
|
||||
class MyComponent extends React.Component<{}, {}> {
|
||||
handleChange = (event: React.SyntheticEvent, results: any) => {
|
||||
results.forEach((result: any) => {
|
||||
const [event, file] = result;
|
||||
console.log(`Selected file ${file.name}!`);
|
||||
});
|
||||
}
|
||||
|
||||
render(): React.ReactElement<{}> {
|
||||
return (
|
||||
<form>
|
||||
<label htmlFor="my-file-input">Upload a File: </label>
|
||||
<FileReaderInput as="binary" onChange={this.handleChange} >
|
||||
<button>Select a file!</button>
|
||||
</FileReaderInput>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Type definitions for react-file-reader-input
|
||||
// Project: https://www.npmjs.com/package/react-file-reader-input
|
||||
// Definitions by: Dmitry Rogozhny <https://github.com/dmitryrogozhny>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../react/react.d.ts" />
|
||||
|
||||
declare module "react-file-reader-input" {
|
||||
import React = __React;
|
||||
|
||||
interface FileInputProps {
|
||||
as?: string;
|
||||
onChange?: (event: React.SyntheticEvent, results: any) => void;
|
||||
}
|
||||
|
||||
class FileInput extends React.Component<FileInputProps, {}> {
|
||||
}
|
||||
|
||||
export = FileInput;
|
||||
}
|
||||
Vendored
+250
-30
@@ -8,9 +8,9 @@
|
||||
// USING: these definitions are meant to be used with the TSC compiler target set to ES6
|
||||
//
|
||||
// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer
|
||||
// Warning: the project currently uses and older version of react-native
|
||||
//
|
||||
// CONTRIBUTING: please open pull requests and make sure that the changes do not break RNTSExplorer (they should not)
|
||||
// Do not hesitate to open a pull request against RNTSExplorer to provide an example for a case not covered by the current App
|
||||
// CONTRIBUTING: please open pull requests
|
||||
//
|
||||
// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie
|
||||
//
|
||||
@@ -434,11 +434,15 @@ declare module "react" {
|
||||
borderWidth?: number
|
||||
bottom?: number
|
||||
flex?: number
|
||||
flexDirection?: "row" | "column"
|
||||
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse"
|
||||
flexWrap?: "wrap" | "nowrap"
|
||||
height?: number
|
||||
justifyContent?: FlexJustifyType
|
||||
left?: number
|
||||
minWidth?: number
|
||||
maxWidth?: number
|
||||
minHeight?: number
|
||||
maxHeight?: number
|
||||
margin?: number
|
||||
marginBottom?: number
|
||||
marginHorizontal?: number
|
||||
@@ -457,6 +461,11 @@ declare module "react" {
|
||||
right?: number
|
||||
top?: number
|
||||
width?: number
|
||||
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
zIndex?: number
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -603,6 +612,12 @@ declare module "react" {
|
||||
*/
|
||||
allowFontScaling?: boolean
|
||||
|
||||
/**
|
||||
* Line Break mode. Works only with numberOfLines.
|
||||
* clip is working only for iOS
|
||||
*/
|
||||
lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip'
|
||||
|
||||
/**
|
||||
* Used to truncate the text with an elipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number.
|
||||
*/
|
||||
@@ -1373,6 +1388,23 @@ declare module "react" {
|
||||
setPageWithoutAnimation: (selectedPage: number) => void
|
||||
}
|
||||
|
||||
export interface KeyboardAvoidingViewStatic extends React.ComponentClass<KeyboardAvoidingViewProps> {
|
||||
|
||||
}
|
||||
|
||||
export interface KeyboardAvoidingViewProps extends ViewProperties, React.Props<KeyboardAvoidingViewStatic> {
|
||||
|
||||
behavior?: 'height' | 'position' | 'padding'
|
||||
|
||||
/**
|
||||
* This is the distance between the top of the user screen and the react native view,
|
||||
* may be non-zero in some use cases.
|
||||
*/
|
||||
keyboardVerticalOffset: number
|
||||
|
||||
ref?: Ref<KeyboardAvoidingViewStatic & ViewStatic>
|
||||
}
|
||||
|
||||
/**
|
||||
* //FIXME: No documentation extracted from code comment on WebView.ios.js
|
||||
*/
|
||||
@@ -1401,6 +1433,17 @@ declare module "react" {
|
||||
domStorageEnabled?: boolean
|
||||
}
|
||||
|
||||
export interface WebViewIOSLoadRequestEvent {
|
||||
target: number
|
||||
canGoBack: boolean
|
||||
lockIdentifier: number
|
||||
loading: boolean
|
||||
title: string
|
||||
canGoForward: boolean
|
||||
navigationType: 'other' | 'click'
|
||||
url: string
|
||||
}
|
||||
|
||||
export interface WebViewPropertiesIOS {
|
||||
|
||||
/**
|
||||
@@ -1430,7 +1473,7 @@ declare module "react" {
|
||||
* Return true or false from this method to continue loading the
|
||||
* request.
|
||||
*/
|
||||
onShouldStartLoadWithRequest?: () => boolean
|
||||
onShouldStartLoadWithRequest?: (event: WebViewIOSLoadRequestEvent) => boolean
|
||||
|
||||
scrollEnabled?: boolean
|
||||
}
|
||||
@@ -1525,12 +1568,12 @@ declare module "react" {
|
||||
/**
|
||||
* view to show if there's an error
|
||||
*/
|
||||
renderError?: () => ViewStatic
|
||||
renderError?: () => React.ReactElement<ViewProperties>
|
||||
|
||||
/**
|
||||
* loading indicator to show
|
||||
*/
|
||||
renderLoading?: () => ViewStatic
|
||||
renderLoading?: () => React.ReactElement<ViewProperties>
|
||||
|
||||
scrollEnabled?: boolean
|
||||
|
||||
@@ -3375,6 +3418,17 @@ declare module "react" {
|
||||
*/
|
||||
popToTop(): void;
|
||||
|
||||
/**
|
||||
* Replace the previous scene and pop to it.
|
||||
*/
|
||||
replacePreviousAndPop( route: Route ): void;
|
||||
|
||||
/**
|
||||
* Navigate to a new scene and reset route stack.
|
||||
*/
|
||||
resetTo( route: Route ): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
namespace NavigatorStatic {
|
||||
@@ -3448,7 +3502,99 @@ declare module "react" {
|
||||
}
|
||||
|
||||
export interface StyleSheetStatic extends React.ComponentClass<StyleSheetProperties> {
|
||||
create<T>(styles: T): T;
|
||||
|
||||
/**
|
||||
* Creates a StyleSheet style reference from the given object.
|
||||
*/
|
||||
create<T>( styles: T ): T;
|
||||
|
||||
/**
|
||||
* Flattens an array of style objects, into one aggregated style object.
|
||||
* Alternatively, this method can be used to lookup IDs, returned by
|
||||
* StyleSheet.register.
|
||||
*
|
||||
* > **NOTE**: Exercise caution as abusing this can tax you in terms of
|
||||
* > optimizations.
|
||||
* >
|
||||
* > IDs enable optimizations through the bridge and memory in general. Refering
|
||||
* > to style objects directly will deprive you of these optimizations.
|
||||
*
|
||||
* Example:
|
||||
* ```
|
||||
* var styles = StyleSheet.create({
|
||||
* listItem: {
|
||||
* flex: 1,
|
||||
* fontSize: 16,
|
||||
* color: 'white'
|
||||
* },
|
||||
* selectedListItem: {
|
||||
* color: 'green'
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* StyleSheet.flatten([styles.listItem, styles.selectedListItem])
|
||||
* // returns { flex: 1, fontSize: 16, color: 'green' }
|
||||
* ```
|
||||
* Alternative use:
|
||||
* ```
|
||||
* StyleSheet.flatten(styles.listItem);
|
||||
* // return { flex: 1, fontSize: 16, color: 'white' }
|
||||
* // Simply styles.listItem would return its ID (number)
|
||||
* ```
|
||||
* This method internally uses `StyleSheetRegistry.getStyleByID(style)`
|
||||
* to resolve style objects represented by IDs. Thus, an array of style
|
||||
* objects (instances of StyleSheet.create), are individually resolved to,
|
||||
* their respective objects, merged as one and then returned. This also explains
|
||||
* the alternative use.
|
||||
*/
|
||||
flatten(style: Object): Object
|
||||
|
||||
/**
|
||||
* This is defined as the width of a thin line on the platform. It can be
|
||||
* used as the thickness of a border or division between two elements.
|
||||
* Example:
|
||||
* ```
|
||||
* {
|
||||
* borderBottomColor: '#bbb',
|
||||
* borderBottomWidth: StyleSheet.hairlineWidth
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This constant will always be a round number of pixels (so a line defined
|
||||
* by it look crisp) and will try to match the standard width of a thin line
|
||||
* on the underlying platform. However, you should not rely on it being a
|
||||
* constant size, because on different platforms and screen densities its
|
||||
* value may be calculated differently.
|
||||
*/
|
||||
hairlineWidth: number
|
||||
|
||||
/**
|
||||
* A very common pattern is to create overlays with position absolute and zero positioning,
|
||||
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
||||
* styles.
|
||||
*/
|
||||
absoluteFill: number
|
||||
|
||||
|
||||
/**
|
||||
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
||||
* used to create a customized entry in a `StyleSheet`, e.g.:
|
||||
*
|
||||
* const styles = StyleSheet.create({
|
||||
* wrapper: {
|
||||
* ...StyleSheet.absoluteFillObject,
|
||||
* top: 10,
|
||||
* backgroundColor: 'transparent',
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
absoluteFillObject: {
|
||||
position: string
|
||||
left: number
|
||||
right: number
|
||||
top: number
|
||||
bottom: number
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3690,8 +3836,10 @@ declare module "react" {
|
||||
export interface PlatformStatic {
|
||||
OS: PlatformOSType,
|
||||
|
||||
// only documented in PlatformSpecificInformation.md
|
||||
select(PlatformOSType: any): any
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content
|
||||
*/
|
||||
select<T>( specifics: { ios?: T, android?: T} ): T;
|
||||
}
|
||||
|
||||
export interface DeviceEventSubscriptionStatic {
|
||||
@@ -3699,7 +3847,22 @@ declare module "react" {
|
||||
}
|
||||
|
||||
export interface DeviceEventEmitterStatic {
|
||||
addListener<T>(type: string, onReceived: (data: T) => void): DeviceEventSubscription;
|
||||
addListener<T>( type: string, onReceived: ( data: T ) => void ): DeviceEventSubscription;
|
||||
|
||||
/**
|
||||
* Removes the given listener for event of specific type.
|
||||
*
|
||||
* @param {string} eventType - Name of the event to emit
|
||||
* @param {function} listener - Function to invoke when the specified event is
|
||||
* emitted
|
||||
*
|
||||
* @example
|
||||
* emitter.removeListener('someEvent', function(message) {
|
||||
* console.log(message);
|
||||
* }); // removes the listener if already registered
|
||||
*
|
||||
*/
|
||||
removeListener( eventType: String, listener: Function): void
|
||||
}
|
||||
|
||||
// Used by Dimensions below
|
||||
@@ -3760,9 +3923,11 @@ declare module "react" {
|
||||
|
||||
/**
|
||||
* Schedule a function to run after all interactions have completed.
|
||||
* Returns a cancellable
|
||||
* @param fn
|
||||
*/
|
||||
runAfterInteractions(fn: () => void | PromiseTask): Promise<any>
|
||||
runAfterInteractions( fn: () => void | PromiseTask):
|
||||
{then: Function, done: Function, cancel: Function}
|
||||
|
||||
/**
|
||||
* Notify manager that an interaction has started.
|
||||
@@ -4079,7 +4244,7 @@ declare module "react" {
|
||||
* A RefreshControl component, used to provide pull-to-refresh
|
||||
* functionality for the ScrollView.
|
||||
*/
|
||||
refreshControl?: RefreshControl
|
||||
refreshControl?: React.ReactElement<RefreshControlProperties>
|
||||
|
||||
ref?: Ref<ScrollViewStatic & ViewStatic>
|
||||
}
|
||||
@@ -4496,6 +4661,22 @@ declare module "react" {
|
||||
*/
|
||||
saveImageWithTag(tag: string): Promise<string>
|
||||
|
||||
/**
|
||||
* Saves the photo or video to the camera roll / gallery.
|
||||
*
|
||||
* On Android, the tag must be a local image or video URI, such as `"file:///sdcard/img.png"`.
|
||||
*
|
||||
* On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs)
|
||||
* or a local video file URI (remote or data URIs are not supported for saving video at this time).
|
||||
*
|
||||
* If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise
|
||||
* it will be treated as a photo. To override the automatic choice, you can pass an optional
|
||||
* `type` parameter that must be one of 'photo' or 'video'.
|
||||
*
|
||||
* Returns a Promise which will resolve with the new URI.
|
||||
*/
|
||||
saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string>
|
||||
|
||||
/**
|
||||
* Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker.
|
||||
*
|
||||
@@ -4954,6 +5135,12 @@ declare module "react" {
|
||||
*/
|
||||
requestPermissions(permissions?: PushNotificationPermissions[]): void
|
||||
|
||||
/**
|
||||
* Requests all notification permissions from iOS, prompting the user's
|
||||
* dialog box.
|
||||
*/
|
||||
requestPermissions( permissions?: PushNotificationPermissions[] ): Promise<PushNotificationPermissions>
|
||||
|
||||
/**
|
||||
* Unregister for all remote notifications received via Apple Push
|
||||
* Notification service.
|
||||
@@ -5064,17 +5251,10 @@ declare module "react" {
|
||||
|
||||
|
||||
/**
|
||||
* //FIXME: No documentation is available (although this is self explanatory)
|
||||
*
|
||||
* @see https://facebook.github.io/react-native/docs/statusbarios.html#content
|
||||
* StatusBarIOS is being deprecated.
|
||||
* @see https://github.com/facebook/react-native/commit/4de616b4c1a9d3556632a93504828f0539fa4fa5
|
||||
*/
|
||||
export interface StatusBarIOSStatic {
|
||||
|
||||
setStyle(style: StatusBarStyle, animated?: boolean): void
|
||||
|
||||
setHidden(hidden: boolean, animation?: StatusBarAnimation): void
|
||||
|
||||
setNetworkActivityIndicatorVisible(visible: boolean): void
|
||||
}
|
||||
|
||||
type TimePickerAndroidOpenOptions = {
|
||||
@@ -5584,26 +5764,25 @@ declare module "react" {
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface NavigationState {
|
||||
key: string;
|
||||
export interface NavigationRoute {
|
||||
key: string;
|
||||
}
|
||||
|
||||
export interface NavigationParentState extends NavigationState {
|
||||
export interface NavigationState extends NavigationRoute {
|
||||
index: number;
|
||||
children: NavigationState[];
|
||||
routes: NavigationRoute[];
|
||||
}
|
||||
|
||||
export type NavigationRenderer = (
|
||||
navigationState: NavigationParentState,
|
||||
route: NavigationState,
|
||||
onNavigate: (action: NavigationAction) => boolean
|
||||
) => JSX.Element;
|
||||
|
||||
// Definitions for NavigationExperimental feature are deduced
|
||||
// from code examples
|
||||
export interface NavigationAnimatedViewStaticProps {
|
||||
navigationState?: any
|
||||
route?: any
|
||||
style?: ViewStyle
|
||||
onNavigate?(action: Object): boolean
|
||||
renderOverlay?(props: Object): JSX.Element
|
||||
applyAnimation(pos: any, navState: Object): void // TODO: what's pos?
|
||||
renderScene?(props: Object): JSX.Element
|
||||
@@ -5614,6 +5793,7 @@ declare module "react" {
|
||||
|
||||
export interface NavigationHeaderProps {
|
||||
renderTitleComponent?(props: Object): JSX.Element
|
||||
onNavigateBack(): void
|
||||
}
|
||||
|
||||
export interface NavigationHeaderStatic extends React.ComponentClass<NavigationHeaderProps> {
|
||||
@@ -5624,9 +5804,9 @@ declare module "react" {
|
||||
export interface NavigationCardStackProps {
|
||||
direction?: 'horizontal' | 'vertical'
|
||||
style?: ViewStyle
|
||||
navigationState?: any
|
||||
onNavigate(action: Object): boolean
|
||||
route?: any
|
||||
renderScene?(props: any /* undocumented on 0.27 */): JSX.Element
|
||||
onNavigateBack(): void
|
||||
}
|
||||
|
||||
export interface NavigationCardStackStatic extends React.ComponentClass<NavigationCardStackProps> {
|
||||
@@ -5659,6 +5839,26 @@ declare module "react" {
|
||||
handleNavigation(action: NavigationAction): boolean;
|
||||
}
|
||||
|
||||
//
|
||||
// Interfacing with Native Modules
|
||||
// https://facebook.github.io/react-native/docs/native-modules-ios.html
|
||||
//
|
||||
|
||||
export interface NativeEventSubscription {
|
||||
/**
|
||||
* Call this method to un-subscribe from a native-event
|
||||
*/
|
||||
remove(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receive events from native-code
|
||||
* @see https://facebook.github.io/react-native/docs/native-modules-ios.html#sending-events-to-javascript
|
||||
*/
|
||||
export interface NativeAppEventEmitterStatic {
|
||||
addListener(event: string, handler: (data: any) => void): NativeEventSubscription;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// R E - E X P O R T S
|
||||
@@ -5810,6 +6010,9 @@ declare module "react" {
|
||||
export var IntentAndroid: IntentAndroidStatic
|
||||
export type IntentAndroid = IntentAndroidStatic
|
||||
|
||||
export var KeyboardAvoidingView: KeyboardAvoidingViewStatic
|
||||
export type KeyboardAvoidingView = KeyboardAvoidingViewStatic
|
||||
|
||||
export var Linking: LinkingStatic
|
||||
export type Linking = LinkingStatic
|
||||
|
||||
@@ -5858,6 +6061,16 @@ declare module "react" {
|
||||
export type Easing = EasingStatic;
|
||||
export var Easing: EasingStatic;
|
||||
|
||||
//Native Modules written in ObjectiveC/Swift/Java exposed via the RCTBridge
|
||||
//See https://facebook.github.io/react-native/docs/native-modules-ios.html
|
||||
|
||||
/**
|
||||
* Use:
|
||||
* <code>const MyModule = NativeModules.ModuleName</code>
|
||||
*/
|
||||
export var NativeModules: any
|
||||
export var NativeAppEventEmitter: NativeAppEventEmitterStatic
|
||||
|
||||
//
|
||||
// /TODO: BGR: These are leftovers of the initial port that must be revisited
|
||||
//
|
||||
@@ -5917,3 +6130,10 @@ declare global {
|
||||
const global: React.GlobalStatic;
|
||||
function require(name: string): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This variable is set to true when react-native is running in Dev mode
|
||||
* Typical usage:
|
||||
* <code> if (__DEV__) console.log('Running in dev mode')</code>
|
||||
*/
|
||||
declare var __DEV__: boolean
|
||||
|
||||
@@ -78,6 +78,28 @@ var styles = StyleSheet.create<LocalStyles>(
|
||||
}
|
||||
)
|
||||
|
||||
//alternative declaration of styles (inline typings)
|
||||
const stylesAlt = StyleSheet.create(
|
||||
{
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
} as React.ViewStyle,
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
} as React.TextStyle,
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
} as React.TextStyle
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class Welcome extends React.Component<any,any> {
|
||||
|
||||
@@ -85,7 +107,7 @@ class Welcome extends React.Component<any,any> {
|
||||
[key: string]: any
|
||||
rootView: View
|
||||
}
|
||||
|
||||
|
||||
testNativeMethods() {
|
||||
// this.setNativeProps({});
|
||||
|
||||
|
||||
Vendored
+1
@@ -79,6 +79,7 @@ interface Select2Options {
|
||||
templateSelection?: (object: Select2SelectionObject) => any;
|
||||
templateResult?: (object: Select2SelectionObject) => any;
|
||||
language?: string | string[] | {};
|
||||
selectOnClose?: boolean;
|
||||
}
|
||||
|
||||
interface Select2JQueryEventObject extends JQueryEventObject {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="sleep.d.ts" />
|
||||
|
||||
import sleep = require("sleep");
|
||||
|
||||
sleep.sleep(1);
|
||||
sleep.usleep(5000);
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for node-scanf
|
||||
// Project: https://github.com/ErikDubbelboer/node-sleep
|
||||
// Definitions by: Jeongho Nam <http://samchon.org>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace __node_sleep
|
||||
{
|
||||
/**
|
||||
* Sleep for <i>n</i> seconds.
|
||||
*
|
||||
* @param n Number of seconds to sleep.
|
||||
*/
|
||||
function sleep(n: number): void;
|
||||
|
||||
/**
|
||||
* Sleep for n microseconds.
|
||||
*
|
||||
* @param n Number of microseconds to sleep; 1 second is 1,000,000 microseconds.
|
||||
*/
|
||||
function usleep(n: number): void;
|
||||
}
|
||||
|
||||
declare module "sleep"
|
||||
{
|
||||
export = __node_sleep;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
import UUID = require("uuid");
|
||||
|
||||
|
||||
const uuid1: string = UUID.generate()
|
||||
const uuid2: UUID.UUID = UUID.genV4()
|
||||
const uuid3: UUID.UUID = UUID.genV1()
|
||||
|
||||
Vendored
+10
@@ -31,6 +31,11 @@ declare namespace webcomponents {
|
||||
whenReady(callback: () => void): void;
|
||||
}
|
||||
|
||||
export interface ShadowRootPolyfill extends DocumentFragment {
|
||||
innerHTML: string;
|
||||
host: Element;
|
||||
}
|
||||
|
||||
export interface Polyfill {
|
||||
flags: any;
|
||||
}
|
||||
@@ -41,6 +46,11 @@ declare module "webcomponents.js" {
|
||||
export = webcomponents;
|
||||
}
|
||||
|
||||
interface Element {
|
||||
createShadowRoot(): webcomponents.ShadowRootPolyfill;
|
||||
shadowRoot?: webcomponents.ShadowRootPolyfill;
|
||||
}
|
||||
|
||||
interface Document {
|
||||
registerElement(name: string, prototype: webcomponents.CustomElementInit): webcomponents.CustomElementConstructor;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,15 @@ window.HTMLImports.whenReady(() => {
|
||||
|
||||
document.querySelectorAll(`link[type=${window.HTMLImports.IMPORT_LINK_TYPE}`);
|
||||
|
||||
/*
|
||||
* Shadow DOM
|
||||
*/
|
||||
|
||||
var shadow = xFoo.createShadowRoot();
|
||||
xFoo.shadowRoot;
|
||||
shadow.innerHTML;
|
||||
shadow.host;
|
||||
|
||||
/*
|
||||
* Web Components
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Combokeys v3.20.0
|
||||
// Type definitions for webpack-stream v3.2.0
|
||||
// Project: https://github.com/shama/webpack-stream
|
||||
// Definitions by: Ian Clanton-Thuon <https://github.com/iclanton>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+6
@@ -41,7 +41,12 @@ type RequestCache =
|
||||
"default" | "no-store" | "reload" | "no-cache" |
|
||||
"force-cache" | "only-if-cached";
|
||||
|
||||
declare interface HeadersMap {
|
||||
[index: string]: string;
|
||||
}
|
||||
|
||||
declare class Headers {
|
||||
constructor(headers?:Headers|HeadersMap)
|
||||
append(name: string, value: string): void;
|
||||
delete(name: string):void;
|
||||
get(name: string): string;
|
||||
@@ -60,6 +65,7 @@ declare class Body {
|
||||
json<T>(): Promise<T>;
|
||||
text(): Promise<string>;
|
||||
}
|
||||
|
||||
declare class Response extends Body {
|
||||
constructor(body?: BodyInit, init?: ResponseInit);
|
||||
static error(): Response;
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
|
||||
|
||||
function test_HeadersCopiedFromHeaders() {
|
||||
var source = new Headers();
|
||||
source.append('Content-Type', 'application/json');
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHash() {
|
||||
var source:HeadersMap = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_fetchUrlWithOptions() {
|
||||
var headers = new Headers();
|
||||
headers.append("Content-Type", "application/json");
|
||||
|
||||
Reference in New Issue
Block a user