mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -247,7 +247,7 @@ new Chartist.Pie('.ct-chart', {
|
||||
value: 70,
|
||||
name: 'Series 3',
|
||||
className: 'my-custom-class-three',
|
||||
meta: 'Meta Three'
|
||||
meta: { description: 'Meta Three' }
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Chartist v0.9.81
|
||||
// Project: https://github.com/gionkunz/chartist-js
|
||||
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>
|
||||
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>, Sunny Juneja <https://github.com/sunnyrjuneja>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Chartist {
|
||||
@@ -101,7 +101,7 @@ declare namespace Chartist {
|
||||
value?: number;
|
||||
data?: Array<number>;
|
||||
className?: string;
|
||||
meta?: string; // I assume this could probably be a number as well?
|
||||
meta?: any;
|
||||
}
|
||||
|
||||
interface IChartistBase<T extends IChartOptions> {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
declare let button: DevExpress.AspNetCore.BootstrapButton;
|
||||
button.on('click', e => {});
|
||||
button.doClick();
|
||||
button.once('click', e => {});
|
||||
|
||||
declare let accordion: DevExpress.AspNetCore.BootstrapAccordion;
|
||||
accordion.on('init', e => {});
|
||||
const firstGroup = accordion.getGroup(0);
|
||||
if (firstGroup) {
|
||||
const groupText = firstGroup.getText();
|
||||
const item = firstGroup.getItemByName('item10');
|
||||
item && item.getEnabled();
|
||||
}
|
||||
+2496
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"devexpress-aspnetcore-bootstrap-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+1
-1
@@ -2368,7 +2368,7 @@ declare module 'ember' {
|
||||
function Exception(message: string): void;
|
||||
class SafeString {
|
||||
constructor(str: string);
|
||||
static toString(): string;
|
||||
toString(): string;
|
||||
}
|
||||
function parse(string: string): any;
|
||||
function print(ast: any): void;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
"only-arrow-functions": false,
|
||||
"no-submodule-imports": false,
|
||||
|
||||
"no-unnecessary-class": false,
|
||||
|
||||
// false positives
|
||||
"unified-signatures": false
|
||||
}
|
||||
|
||||
@@ -1,17 +1,39 @@
|
||||
import EventSource = require("eventsource");
|
||||
|
||||
const eventSource = new EventSource("http://foobar");
|
||||
eventSource.onmessage = (x: any) => {};
|
||||
eventSource.onerror = (x: any) => {};
|
||||
eventSource.onopen = (x: any) => {};
|
||||
eventSource.addEventListener = (type: string, x: any) => {};
|
||||
let readyState: number = eventSource.readyState;
|
||||
let closedState: number = eventSource.CLOSED;
|
||||
closedState = EventSource.CLOSED;
|
||||
let connectingState: number = eventSource.CONNECTING;
|
||||
connectingState = EventSource.CONNECTING;
|
||||
let openState: number = eventSource.OPEN;
|
||||
openState = EventSource.OPEN;
|
||||
let url: string = eventSource.url;
|
||||
let withCredentials: boolean = eventSource.withCredentials;
|
||||
eventSource.onmessage = (event: Event) => {};
|
||||
eventSource.onerror = (event: Event) => {};
|
||||
eventSource.onopen = (event: Event) => {};
|
||||
eventSource.addEventListener = (type: string, listener: (e: Event) => void) => {};
|
||||
eventSource.dispatchEvent = (event: Event) => true;
|
||||
eventSource.removeEventListener = (type: string, listener: (e: Event) => void) => {};
|
||||
eventSource.close();
|
||||
|
||||
import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill");
|
||||
|
||||
const eventSourcePolyfill = new EventSourcePolyfill("http://foobar");
|
||||
eventSourcePolyfill.onmessage = (x: any) => {};
|
||||
eventSourcePolyfill.onerror = (x: any) => {};
|
||||
eventSourcePolyfill.onopen = (x: any) => {};
|
||||
eventSourcePolyfill.addEventListener = (type: string, x: any) => {};
|
||||
readyState = eventSourcePolyfill.readyState;
|
||||
closedState = eventSource.CLOSED;
|
||||
closedState = EventSource.CLOSED;
|
||||
connectingState = eventSource.CONNECTING;
|
||||
connectingState = EventSource.CONNECTING;
|
||||
openState = eventSource.OPEN;
|
||||
openState = EventSource.OPEN;
|
||||
url = eventSourcePolyfill.url;
|
||||
withCredentials = eventSource.withCredentials;
|
||||
eventSourcePolyfill.onmessage = (event: Event) => {};
|
||||
eventSourcePolyfill.onerror = (event: Event) => {};
|
||||
eventSourcePolyfill.onopen = (event: Event) => {};
|
||||
eventSourcePolyfill.addEventListener = (type: string, listener: (e: Event) => void) => {};
|
||||
eventSourcePolyfill.dispatchEvent = (event: Event) => true;
|
||||
eventSourcePolyfill.removeEventListener = (type: string, listener: (e: Event) => void) => {};
|
||||
eventSourcePolyfill.close();
|
||||
|
||||
Vendored
+14
-7
@@ -1,22 +1,29 @@
|
||||
// Type definitions for eventsource 1.0
|
||||
// Project: http://github.com/EventSource/eventsource
|
||||
// Definitions by: Scott Lee Davis <https://github.com/scottleedavis>
|
||||
// Ali Afroozeh <https://github.com/afroozeh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
declare class EventSource {
|
||||
static readonly CLOSED: number;
|
||||
static readonly CONNECTING: number;
|
||||
static readonly OPEN: number;
|
||||
|
||||
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
|
||||
|
||||
static CLOSED: EventSource.ReadyState;
|
||||
static CONNECTING: EventSource.ReadyState;
|
||||
static OPEN: EventSource.ReadyState;
|
||||
|
||||
url: string;
|
||||
readyState: EventSource.ReadyState;
|
||||
readonly CLOSED: number;
|
||||
readonly CONNECTING: number;
|
||||
readonly OPEN: number;
|
||||
readonly url: string;
|
||||
readonly readyState: number;
|
||||
readonly withCredentials: boolean;
|
||||
onopen: EventListener;
|
||||
onmessage: EventListener;
|
||||
onerror: EventListener;
|
||||
addEventListener(type: string, listener: EventListener): void;
|
||||
dispatchEvent(evt: Event): boolean;
|
||||
removeEventListener(type: string, listener?: EventListener): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
|
||||
+12
-6
@@ -1,16 +1,22 @@
|
||||
declare class EventSource {
|
||||
static readonly CLOSED: number;
|
||||
static readonly CONNECTING: number;
|
||||
static readonly OPEN: number;
|
||||
|
||||
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
|
||||
|
||||
static CLOSED: EventSource.ReadyState;
|
||||
static CONNECTING: EventSource.ReadyState;
|
||||
static OPEN: EventSource.ReadyState;
|
||||
|
||||
url: string;
|
||||
readyState: EventSource.ReadyState;
|
||||
readonly CLOSED: number;
|
||||
readonly CONNECTING: number;
|
||||
readonly OPEN: number;
|
||||
readonly url: string;
|
||||
readonly readyState: number;
|
||||
readonly withCredentials: boolean;
|
||||
onopen: EventListener;
|
||||
onmessage: EventListener;
|
||||
onerror: EventListener;
|
||||
addEventListener(type: string, listener: EventListener): void;
|
||||
dispatchEvent(evt: Event): boolean;
|
||||
removeEventListener(type: string, listener?: EventListener): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for intl-locales-supported 1.0
|
||||
// Project: https://github.com/yahoo/intl-locales-supported
|
||||
// Definitions by: Edward Sammut Alessi <https://github.com/Slessi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = areIntlLocalesSupported;
|
||||
|
||||
declare function areIntlLocalesSupported(locales: string | string[]): boolean;
|
||||
@@ -0,0 +1,4 @@
|
||||
import areIntlLocalesSupported = require("intl-locales-supported");
|
||||
|
||||
areIntlLocalesSupported("en-GB");
|
||||
areIntlLocalesSupported([ "en-GB", "en-US" ]);
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"intl-locales-supported-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+6
@@ -13,6 +13,7 @@
|
||||
// Ahn <https://github.com/AhnpGit>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Bradley Ayers <https://github.com/bradleyayers>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -473,6 +474,11 @@ declare namespace jest {
|
||||
* to test what arguments it was last called with.
|
||||
*/
|
||||
toHaveBeenLastCalledWith(...params: any[]): R;
|
||||
/**
|
||||
* If you have a mock function, you can use `.toHaveBeenNthCalledWith`
|
||||
* to test what arguments it was nth called with.
|
||||
*/
|
||||
toHaveBeenNthCalledWith(nthCall: number, ...params: any[]): R;
|
||||
/**
|
||||
* Used to check that an object has a `.length` property
|
||||
* and it is set to a certain numeric value.
|
||||
|
||||
@@ -731,3 +731,9 @@ test('moduleName 2', () => {
|
||||
const moduleName = require('../moduleName');
|
||||
expect(moduleName()).toEqual(2);
|
||||
});
|
||||
|
||||
describe('toHaveBeenNthCalledWith', () => {
|
||||
const fn = jest.fn();
|
||||
|
||||
expect(fn).toHaveBeenNthCalledWith(3, "foo");
|
||||
});
|
||||
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for jsreport-html-to-xlsx 1.4
|
||||
// Type definitions for jsreport-html-to-xlsx 2.0
|
||||
// Project: https://github.com/jsreport/jsreport-html-to-xlsx
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -8,7 +8,9 @@ import { ExtensionDefinition } from 'jsreport-core';
|
||||
import { Options as BaseOptions } from 'jsreport-xlsx';
|
||||
|
||||
declare module 'jsreport-core' {
|
||||
type htmlEngine = 'phantom' | 'chrome';
|
||||
interface Template {
|
||||
htmlToXlsx: { htmlEngine: htmlEngine; };
|
||||
recipe: 'html-to-xlsx' | string;
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for jsreport-html-to-xlsx 1.4
|
||||
// Project: https://github.com/jsreport/jsreport-html-to-xlsx
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { ExtensionDefinition } from 'jsreport-core';
|
||||
import { Options as BaseOptions } from 'jsreport-xlsx';
|
||||
|
||||
declare module 'jsreport-core' {
|
||||
interface Template {
|
||||
recipe: 'html-to-xlsx' | string;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace JsReportHtml2Xlsx {
|
||||
interface Options extends BaseOptions {
|
||||
strategy: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function JsReportHtml2Xlsx(options?: Partial<JsReportHtml2Xlsx.Options>): ExtensionDefinition;
|
||||
|
||||
export = JsReportHtml2Xlsx;
|
||||
@@ -0,0 +1,19 @@
|
||||
import JsReport = require('jsreport-core');
|
||||
import JsreportHtml2Xlsx = require('jsreport-html-to-xlsx');
|
||||
import JsreportXlsx = require('jsreport-xlsx');
|
||||
|
||||
const jsreport = JsReport();
|
||||
jsreport.use(JsreportXlsx());
|
||||
jsreport.use(JsreportHtml2Xlsx());
|
||||
|
||||
(async () => {
|
||||
const content = `<table><tr><td>test</td></tr></table>`;
|
||||
await jsreport.init();
|
||||
const resp = await jsreport.render({
|
||||
template: {
|
||||
content,
|
||||
engine: 'none',
|
||||
recipe: 'xlsx'
|
||||
}
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"esnext"
|
||||
],
|
||||
"strictFunctionTypes": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"jsreport-html-to-xlsx": [ "jsreport-html-to-xlsx/v1" ]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jsreport-html-to-xlsx-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+133
-74
@@ -1,114 +1,173 @@
|
||||
// Type definitions for Libxmljs v0.14.2
|
||||
// Project: https://github.com/polotek/libxmljs
|
||||
// Type definitions for Libxmljs 0.18
|
||||
// Project: https://github.com/libxmljs/libxmljs
|
||||
// Definitions by: François de Campredon <https://github.com/fdecampredon>
|
||||
// ComFreek <https://github.com/ComFreek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export const version: string;
|
||||
export const libxml_version: string;
|
||||
export const libxml_parser_version: string;
|
||||
|
||||
// tslint:disable-next-line:strict-export-declare-modifiers
|
||||
interface ParseOptions {
|
||||
[optionName: string]: string;
|
||||
}
|
||||
|
||||
import events = require('events');
|
||||
export function parseXml(source: string, options?: ParseOptions): Document;
|
||||
export function parseXmlString(source: string, options?: ParseOptions): Document;
|
||||
|
||||
export declare function parseXml(source: string): XMLDocument;
|
||||
export declare function parseHtml(source: string): HTMLDocument;
|
||||
export declare function parseXmlString(source: string, options?: { [key: string]: string }): XMLDocument;
|
||||
export declare function parseHtmlString(source: string): HTMLDocument;
|
||||
export function parseHtml(source: string, options?: ParseOptions): Document;
|
||||
export function parseHtmlString(source: string, options?: ParseOptions): Document;
|
||||
export function parseHtmlFragment(source: string, options?: ParseOptions): Document;
|
||||
|
||||
export function memoryUsage(): number;
|
||||
export function nodeCount(): number;
|
||||
|
||||
export declare class XMLDocument {
|
||||
constructor(version: number, encoding: string);
|
||||
child(idx: number): Element | undefined;
|
||||
export class Document {
|
||||
/**
|
||||
* Create a new XML Document
|
||||
* @param version XML document version, defaults to 1.0
|
||||
* @param encoding Encoding, defaults to utf8
|
||||
*/
|
||||
constructor(version?: number, encoding?: string);
|
||||
|
||||
errors: SyntaxError[];
|
||||
|
||||
child(idx: number): Element|null;
|
||||
childNodes(): Element[];
|
||||
errors(): SyntaxError[];
|
||||
encoding(): string;
|
||||
encoding(enc: string): void;
|
||||
encoding(enc: string): this;
|
||||
find(xpath: string): Element[];
|
||||
get(xpath: string): Element | undefined;
|
||||
node(name: string, content: string): Element;
|
||||
root(): Element;
|
||||
toString(): string;
|
||||
validate(xsdDoc: XMLDocument): boolean;
|
||||
validationErrors: XmlError[];
|
||||
version(): Number;
|
||||
get(xpath: string): Element|null;
|
||||
node(name: string, content?: string): Element;
|
||||
root(): Element|null;
|
||||
root(newRoot: Node): Node;
|
||||
toString(formatted?: boolean): string;
|
||||
type(): 'document';
|
||||
version(): string;
|
||||
setDtd(name: string, ext: string, sys: string): void;
|
||||
getDtd(): {
|
||||
name: string;
|
||||
externalId: string;
|
||||
systemId: string;
|
||||
};
|
||||
}
|
||||
|
||||
export declare class HTMLDocument extends XMLDocument {
|
||||
export class Node {
|
||||
doc(): Document;
|
||||
parent(): Element|Document;
|
||||
/**
|
||||
* The namespace or null in case of comment nodes
|
||||
*/
|
||||
namespace(): Namespace|null;
|
||||
|
||||
/**
|
||||
* An array of namespaces that the object belongs to.
|
||||
*
|
||||
* @param local If it is true, only the namespace declarations local to this
|
||||
* node are returned, rather than all of the namespaces in scope
|
||||
* at this node (including the ones from the parent elements).
|
||||
*/
|
||||
namespaces(local?: boolean): Namespace[];
|
||||
|
||||
prevSibling(): Node|null;
|
||||
nextSibling(): Node|null;
|
||||
|
||||
type(): 'comment'|'element'|'text'|'attribute';
|
||||
remove(): this;
|
||||
clone(): this;
|
||||
/**
|
||||
* Serializes the node to a string. The string will contain all contents of the node formatted as XML and can be used to print the node.
|
||||
*/
|
||||
toString(format?: boolean|{
|
||||
declaration: boolean;
|
||||
selfCloseEmpty: boolean;
|
||||
whitespace: boolean;
|
||||
type: 'xml'|'html'|'xhtml'
|
||||
}): string;
|
||||
}
|
||||
|
||||
|
||||
export declare class Element {
|
||||
constructor(doc: XMLDocument, name: string, content?: string);
|
||||
export class Element extends Node {
|
||||
constructor(doc: Document, name: string, content?: string);
|
||||
node(name: string, content?: string): Element;
|
||||
name(): string;
|
||||
name(newName: string): void;
|
||||
name(newName: string): this;
|
||||
text(): string;
|
||||
attr(name: string): Attribute;
|
||||
attr(attr: Attribute): void;
|
||||
attr(attrObject: { [key: string]: string; }): void;
|
||||
text(newText: string): this;
|
||||
attr(name: string): Attribute|null;
|
||||
attr(attrObject: { [key: string]: string; }): this;
|
||||
attrs(): Attribute[];
|
||||
parent(): Element;
|
||||
doc(): XMLDocument;
|
||||
child(idx: number): Element | undefined;
|
||||
childNodes(): Element[];
|
||||
addChild(child: Element): Element;
|
||||
nextSibling(): Element;
|
||||
nextElement(): Element;
|
||||
addNextSibling(siblingNode: Element): Element;
|
||||
prevSibling(): Element;
|
||||
prevElement(): Element;
|
||||
addPrevSibling(siblingNode: Element): Element;
|
||||
find(xpath: string): Element[];
|
||||
find(xpath: string, ns_uri: string): Element[];
|
||||
find(xpath: string, namespaces: { [key: string]: string; }): Element[];
|
||||
get(xpath: string): Element | undefined;
|
||||
get(xpath: string, ns_uri: string): Element | undefined;
|
||||
get(xpath: string, ns_uri: { [key: string]: string; }): Element | undefined;
|
||||
defineNamespace(href: string): Namespace;
|
||||
defineNamespace(prefix: string, href: string): Namespace;
|
||||
namespace(): Namespace;
|
||||
namespace(ns: Namespace): void;
|
||||
namespace(href: string): void;
|
||||
namespace(prefix: string, href: string): void;
|
||||
remove(): void;
|
||||
|
||||
doc(): Document;
|
||||
child(idx: number): Node | null;
|
||||
childNodes(): Node[];
|
||||
|
||||
/**
|
||||
* @return The original element, not the child.
|
||||
*/
|
||||
addChild(child: Element): this;
|
||||
|
||||
prevElement(): Element|null;
|
||||
nextElement(): Element|null;
|
||||
addNextSibling(siblingNode: Node): Node;
|
||||
|
||||
find(xpath: string, ns_uri?: string): Node[];
|
||||
find(xpath: string, namespaces: { [key: string]: string; }): Node[];
|
||||
get(xpath: string, ns_uri?: string): Element|null;
|
||||
|
||||
defineNamespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace;
|
||||
|
||||
namespace(): Namespace|null;
|
||||
namespace(newNamespace: Namespace): this;
|
||||
namespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace;
|
||||
|
||||
replace(replacement: string): string;
|
||||
replace(replacement: Element): Element;
|
||||
|
||||
path(): string;
|
||||
type(): string;
|
||||
}
|
||||
|
||||
|
||||
export declare class Attribute {
|
||||
constructor(node: Element, name: string, value: string);
|
||||
constructor(node: Element, name: string, value: string, ns: Namespace);
|
||||
export class Attribute {
|
||||
name(): string;
|
||||
namespace(): Namespace;
|
||||
namespace(ns: Namespace): Namespace;
|
||||
nextSibling(): Attribute;
|
||||
node(): Element;
|
||||
prevSibling(): Attribute;
|
||||
remove(): void;
|
||||
value(): string;
|
||||
value(newValue: string): Attribute;
|
||||
namespace(): Namespace;
|
||||
|
||||
remove(): void;
|
||||
}
|
||||
|
||||
export declare class Namespace {
|
||||
constructor(node: Element, prefix: string, href: string);
|
||||
export class Namespace {
|
||||
href(): string;
|
||||
prefix(): string;
|
||||
}
|
||||
|
||||
export declare class SaxParser extends events.EventEmitter {
|
||||
export class SaxParser extends EventEmitter {
|
||||
constructor();
|
||||
parseString(source: string): boolean;
|
||||
}
|
||||
|
||||
|
||||
export declare class SaxPushParser extends events.EventEmitter {
|
||||
export class SaxPushParser extends EventEmitter {
|
||||
constructor();
|
||||
push(source: string): boolean;
|
||||
}
|
||||
|
||||
export interface XmlError {
|
||||
domain: number;
|
||||
code: number;
|
||||
message: string;
|
||||
level: number;
|
||||
file?: string;
|
||||
export interface SyntaxError {
|
||||
domain: number|null;
|
||||
code: number|null;
|
||||
message: string|null;
|
||||
level: number|null;
|
||||
file: string|null;
|
||||
line: number|null;
|
||||
/**
|
||||
* 1-based column number, 0 if not applicable/available.
|
||||
*/
|
||||
column: number;
|
||||
line: number;
|
||||
|
||||
str1: number|null;
|
||||
str2: number|null;
|
||||
str3: number|null;
|
||||
int1: number|null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as libxmljs from 'libxmljs';
|
||||
|
||||
|
||||
var libxmljs = require("libxmljs");
|
||||
var xml = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
const xml = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<root>' +
|
||||
'<child foo="bar">' +
|
||||
'<grandchild baz="fizbuzz">grandchild content</grandchild>' +
|
||||
@@ -9,40 +8,42 @@ var xml = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<sibling>with content!</sibling>' +
|
||||
'</root>';
|
||||
|
||||
var xmlDoc = libxmljs.parseXml(xml);
|
||||
const xmlDoc = libxmljs.parseXml(xml);
|
||||
|
||||
// xpath queries
|
||||
var gchild = xmlDoc.get('//grandchild');
|
||||
const gchild = xmlDoc.get('//grandchild')!;
|
||||
|
||||
console.log(gchild.text()); // prints "grandchild content"
|
||||
|
||||
var children = xmlDoc.root().childNodes();
|
||||
var child = children[0];
|
||||
const children = xmlDoc.root()!.childNodes();
|
||||
const child = children[0] as libxmljs.Element;
|
||||
|
||||
console.log(child.attr('foo').value()); // prints "bar"
|
||||
console.log(child.attr('foo')!.value()); // prints "bar"
|
||||
|
||||
var parser = new libxmljs.SaxParser();
|
||||
const parser = new libxmljs.SaxParser();
|
||||
|
||||
parser.on('startDocument', null);
|
||||
parser.on('startElement', null);
|
||||
parser.on('startDocument', () => 0);
|
||||
parser.on('startElement', () => 0);
|
||||
|
||||
var parser2 = new libxmljs.SaxPushParser();
|
||||
const parser2 = new libxmljs.SaxPushParser();
|
||||
|
||||
// connect any callbacks here
|
||||
parser2
|
||||
.on('startDocument', null)
|
||||
.on('startElement', null)
|
||||
.on('startDocument', () => 0)
|
||||
.on('startElement', () => 0);
|
||||
|
||||
var xmlChunk: any;
|
||||
const xmlChunk = '';
|
||||
|
||||
while(xmlChunk) {
|
||||
while (xmlChunk) {
|
||||
parser2.push(xmlChunk);
|
||||
}
|
||||
|
||||
var doc = new libxmljs.Document();
|
||||
doc.node('root')
|
||||
const doc = new libxmljs.Document();
|
||||
((doc.node('root')
|
||||
.node('child').attr({foo: 'bar'})
|
||||
.node('grandchild', 'grandchild content').attr({baz: 'fizbuzz'})
|
||||
.parent()
|
||||
.parent()
|
||||
) as libxmljs.Element).parent()
|
||||
.node('sibling', 'with content!');
|
||||
|
||||
const {name, externalId, systemId} = doc.getDtd();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Vendored
+17
-39
@@ -1,59 +1,37 @@
|
||||
// Type definitions for node-libxslt
|
||||
// Type definitions for node-libxslt 0.7
|
||||
// Project: https://github.com/albanm/node-libxslt
|
||||
// Definitions by: Alejandro Sánchez <https://github.com/alejo90>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="libxmljs" />
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import * as xmljs from 'libxmljs';
|
||||
|
||||
import {
|
||||
ApplyCallback,
|
||||
ApplyResult,
|
||||
ApplyStringCallback,
|
||||
OutputFormat,
|
||||
ParseCallback
|
||||
} from './internal-types';
|
||||
export const libxmljs: typeof xmljs;
|
||||
|
||||
type OutputFormat = 'document' | 'string';
|
||||
|
||||
export interface ApplyOptions {
|
||||
outputFormat?: OutputFormat;
|
||||
noWrapParams?: boolean;
|
||||
}
|
||||
|
||||
type ApplyResult = string | xmljs.XMLDocument;
|
||||
|
||||
type ApplyCallback = (err: Error, result: ApplyResult) => void;
|
||||
|
||||
type ApplyStringCallback = (err: Error, result: string) => void;
|
||||
|
||||
type ApplyDocumentCallback = (err: Error, result: xmljs.XMLDocument) => void;
|
||||
|
||||
export interface Stylesheet {
|
||||
apply(source: string, params?: Object): string;
|
||||
|
||||
apply(source: string, params: Object, options: ApplyOptions): ApplyResult;
|
||||
|
||||
apply(source: string, params: Object, options: ApplyOptions, callback: ApplyCallback): void;
|
||||
|
||||
apply(source: string, callback: ApplyStringCallback): void;
|
||||
|
||||
apply(source: xmljs.XMLDocument, params?: Object): xmljs.XMLDocument;
|
||||
|
||||
apply(source: xmljs.XMLDocument, params: Object, options: ApplyOptions): ApplyResult;
|
||||
|
||||
apply(source: xmljs.XMLDocument, params: Object, options: ApplyOptions, callback: ApplyCallback): void;
|
||||
|
||||
apply(source: xmljs.XMLDocument, callback: ApplyDocumentCallback): void;
|
||||
|
||||
applyToFile(sourcePath: string, params: Object, options: ApplyOptions, callback: ApplyStringCallback): void;
|
||||
apply(source: string, params?: object): string;
|
||||
apply(source: string|xmljs.Document, params: object, options: ApplyOptions): ApplyResult;
|
||||
apply(source: string|xmljs.Document, params: object, options: ApplyOptions, callback: ApplyCallback): void;
|
||||
apply(source: string|xmljs.Document, callback: ApplyStringCallback): void;
|
||||
apply(source: xmljs.Document, params?: object): xmljs.Document;
|
||||
|
||||
applyToFile(sourcePath: string, params: object, options: ApplyOptions, callback: ApplyStringCallback): void;
|
||||
applyToFile(sourcePath: string, callback: ApplyStringCallback): void;
|
||||
}
|
||||
|
||||
type ParseCallback = (err: Error, stylesheet: Stylesheet) => void;
|
||||
|
||||
export function parse(source: string): Stylesheet;
|
||||
|
||||
export function parse(source: string, callback: ParseCallback): void;
|
||||
|
||||
export function parse(source: xmljs.XMLDocument): Stylesheet;
|
||||
|
||||
export function parse(source: xmljs.XMLDocument, callback: ParseCallback): void;
|
||||
export function parse(source: string|xmljs.Document): Stylesheet;
|
||||
export function parse(source: string|xmljs.Document, callback: ParseCallback): void;
|
||||
|
||||
export function parseFile(sourcePath: string, callback: ParseCallback): void;
|
||||
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import * as xmljs from 'libxmljs';
|
||||
import { Stylesheet } from './index';
|
||||
|
||||
export type OutputFormat = 'document' | 'string';
|
||||
|
||||
export type ApplyResult = string | xmljs.Document;
|
||||
export type ApplyCallback = (err: Error, result: ApplyResult) => void;
|
||||
export type ApplyStringCallback = (err: Error, result: string) => void;
|
||||
export type ApplyDocumentCallback = (err: Error, result: xmljs.Document) => void;
|
||||
|
||||
export type ParseCallback = (err: Error, stylesheet: Stylesheet) => void;
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as libxslt from 'libxslt';
|
||||
import * as libxmljs from 'libxmljs';
|
||||
|
||||
const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString('<xml></xml>');
|
||||
const document: libxmljs.Document = libxslt.libxmljs.parseXmlString('<xml></xml>');
|
||||
|
||||
let stylesheet: libxslt.Stylesheet;
|
||||
|
||||
@@ -36,7 +36,7 @@ applyOptions = {
|
||||
|
||||
let transformedString: string;
|
||||
|
||||
let transformedDocument: libxmljs.XMLDocument;
|
||||
let transformedDocument: libxmljs.Document;
|
||||
|
||||
transformedString = stylesheet.apply('<xml></xml>');
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"internal-types.d.ts",
|
||||
"libxslt-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/zeit/next.js
|
||||
// Definitions by: Drew Hays <https://github.com/dru89>
|
||||
// Brice BERNARD <https://github.com/brikou>
|
||||
// Scott Jones <https://github.com/scottdj92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
|
||||
Vendored
+9
-5
@@ -9,10 +9,7 @@ export interface EventChangeOptions {
|
||||
}
|
||||
|
||||
export type RouterCallback = () => void;
|
||||
export interface SingletonRouter {
|
||||
readyCallbacks: RouterCallback[];
|
||||
ready(cb: RouterCallback): void;
|
||||
|
||||
export interface RouterProps {
|
||||
// router properties
|
||||
readonly components: {
|
||||
[key: string]: { Component: React.ComponentType<any>; err: any };
|
||||
@@ -53,9 +50,16 @@ export interface SingletonRouter {
|
||||
onRouteChangeError?(error: any, url: string): void;
|
||||
}
|
||||
|
||||
export interface SingletonRouter {
|
||||
router: RouterProps;
|
||||
readyCallbacks: RouterCallback[];
|
||||
ready(cb: RouterCallback): void;
|
||||
}
|
||||
|
||||
export function withRouter<T extends {}>(
|
||||
Component: React.ComponentType<T & { router: SingletonRouter }>,
|
||||
Component: React.ComponentType<T & SingletonRouter>,
|
||||
): React.ComponentType<T>;
|
||||
|
||||
export const Singleton: SingletonRouter;
|
||||
export type ImperativeRouter = RouterProps;
|
||||
export default Singleton;
|
||||
|
||||
@@ -13,8 +13,8 @@ Router.ready(() => {
|
||||
|
||||
// Access readonly properties of the router.
|
||||
|
||||
Object.keys(Router.components).forEach(key => {
|
||||
const c = Router.components[key];
|
||||
Object.keys(Router.router.components).forEach(key => {
|
||||
const c = Router.router.components[key];
|
||||
c.err.isAnAny;
|
||||
|
||||
return <c.Component />;
|
||||
@@ -26,51 +26,51 @@ function split(routeLike: string) {
|
||||
});
|
||||
}
|
||||
|
||||
if (Router.asPath) {
|
||||
split(Router.asPath);
|
||||
split(Router.asPath);
|
||||
if (Router.router.asPath) {
|
||||
split(Router.router.asPath);
|
||||
split(Router.router.asPath);
|
||||
}
|
||||
|
||||
split(Router.pathname);
|
||||
split(Router.router.pathname);
|
||||
|
||||
const query = `?${qs.stringify(Router.query)}`;
|
||||
const query = `?${qs.stringify(Router.router.query)}`;
|
||||
|
||||
// Assign some callback methods.
|
||||
Router.onAppUpdated = (nextRoute: string) => console.log(nextRoute);
|
||||
Router.onRouteChangeStart = (url: string) =>
|
||||
Router.router.onAppUpdated = (nextRoute: string) => console.log(nextRoute);
|
||||
Router.router.onRouteChangeStart = (url: string) =>
|
||||
console.log("Route is starting to change.", url);
|
||||
Router.onBeforeHistoryChange = (as: string) =>
|
||||
Router.router.onBeforeHistoryChange = (as: string) =>
|
||||
console.log("History hasn't changed yet.", as);
|
||||
Router.onRouteChangeComplete = (url: string) =>
|
||||
Router.router.onRouteChangeComplete = (url: string) =>
|
||||
console.log("Route chaneg is complete.", url);
|
||||
Router.onRouteChangeError = (err: any, url: string) =>
|
||||
Router.router.onRouteChangeError = (err: any, url: string) =>
|
||||
console.log("Route is starting to change.", url, err);
|
||||
|
||||
// Call methods on the router itself.
|
||||
Router.reload("/route").then(() => console.log("route was reloaded"));
|
||||
Router.back();
|
||||
Router.router.reload("/route").then(() => console.log("route was reloaded"));
|
||||
Router.router.back();
|
||||
|
||||
Router.push("/route").then((success: boolean) =>
|
||||
Router.router.push("/route").then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
Router.push("/route", "/asRoute").then((success: boolean) =>
|
||||
Router.router.push("/route", "/asRoute").then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) =>
|
||||
Router.router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) =>
|
||||
console.log("route push success: ", success),
|
||||
);
|
||||
|
||||
Router.replace("/route").then((success: boolean) =>
|
||||
Router.router.replace("/route").then((success: boolean) =>
|
||||
console.log("route replace success: ", success),
|
||||
);
|
||||
Router.replace("/route", "/asRoute").then((success: boolean) =>
|
||||
Router.router.replace("/route", "/asRoute").then((success: boolean) =>
|
||||
console.log("route replace success: ", success),
|
||||
);
|
||||
Router.replace("/route", "/asRoute", {
|
||||
Router.router.replace("/route", "/asRoute", {
|
||||
shallow: false,
|
||||
}).then((success: boolean) => console.log("route replace success: ", success));
|
||||
|
||||
Router.prefetch("/route").then(Component => {
|
||||
Router.router.prefetch("/route").then(Component => {
|
||||
const element = <Component />;
|
||||
});
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
||||
import { Object } from './object';
|
||||
|
||||
export class DiffBinaryFile {
|
||||
type: number;
|
||||
type: Object.TYPE;
|
||||
data: string;
|
||||
datalen: number;
|
||||
inflatedlen: number;
|
||||
|
||||
Vendored
+22
-7
@@ -3,20 +3,35 @@ import { Repository } from './repository';
|
||||
import { Buf } from './buf';
|
||||
|
||||
export class Object {
|
||||
static size(type: number): number;
|
||||
static lookup(repo: Repository, id: Oid, type: number): Promise<Object>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise<Object>;
|
||||
static string2type(str: string): number;
|
||||
static type2string(type: number): string;
|
||||
static typeisloose(type: number): number;
|
||||
static size(type: Object.TYPE): number;
|
||||
static lookup(repo: Repository, id: Oid, type: Object.TYPE): Promise<Object>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number, type: Object.TYPE): Promise<Object>;
|
||||
static string2Type(str: string): Object.TYPE;
|
||||
static type2String(type: Object.TYPE): string;
|
||||
static typeisloose(type: Object.TYPE): number;
|
||||
|
||||
dup(): Promise<Object>;
|
||||
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
lookupByPath(path: string, type: number): Promise<Object>;
|
||||
lookupByPath(path: string, type: Object.TYPE): Promise<Object>;
|
||||
owner(): Repository;
|
||||
peel(targetType: number): Promise<Object>;
|
||||
shortId(): Promise<Buf>;
|
||||
type(): number;
|
||||
}
|
||||
|
||||
export namespace Object {
|
||||
const enum TYPE {
|
||||
ANY = -2,
|
||||
BAD = -1,
|
||||
EXT1 = 0,
|
||||
COMMIT = 1,
|
||||
TREE = 2,
|
||||
BLOB = 3,
|
||||
TAG = 4,
|
||||
EXT2 = 5,
|
||||
OFS_DELTA = 6,
|
||||
REF_DELTA = 7
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -1,7 +1,8 @@
|
||||
import { Oid } from './oid';
|
||||
import { Object } from './object';
|
||||
|
||||
export class OdbExpandId {
|
||||
id: Oid;
|
||||
length: number;
|
||||
type: number;
|
||||
type: Object.TYPE;
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
import { Oid } from './oid';
|
||||
import { OdbObject } from './odb-object';
|
||||
import { OdbExpandId } from './odb-expand-id';
|
||||
import { Object } from './object';
|
||||
|
||||
export namespace Odb {
|
||||
const enum STREAM {
|
||||
@@ -17,6 +18,6 @@ export class Odb {
|
||||
|
||||
free(): void;
|
||||
read(id: Oid): Promise<OdbObject>;
|
||||
write(data: Buffer, len: number, type: number): Promise<Oid>;
|
||||
write(data: Buffer, len: number, type: Object.TYPE): Promise<Oid>;
|
||||
expandIds(ids: OdbExpandId, count: number): number;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ export class Reference {
|
||||
isTag(): number;
|
||||
name(): string;
|
||||
owner(): Repository;
|
||||
peel(type: number): Promise<Object>;
|
||||
peel(type: Object.TYPE): Promise<Object>;
|
||||
rename(newName: string, force: number, logMessage: string): Promise<Reference>;
|
||||
resolve(): Promise<Reference>;
|
||||
setTarget(id: Oid, logMessage: string): Promise<Reference>;
|
||||
|
||||
Vendored
+13
-47
@@ -1,6 +1,6 @@
|
||||
// Type definitions for qrcode 0.8.2
|
||||
// Type definitions for qrcode 1.2
|
||||
// Project: https://github.com/soldair/node-qrcode
|
||||
// Definitions by: York Yao <https://github.com/plantain-00/>
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -22,7 +22,7 @@ export interface QRCodeOptions {
|
||||
* Helper function used internally to convert a kanji to its Shift JIS value.
|
||||
* Provide this function if you need support for Kanji mode.
|
||||
*/
|
||||
toSJISFunc?: Function;
|
||||
toSJISFunc?: (codePoint: string) => number;
|
||||
}
|
||||
|
||||
export interface QRCodeToDataURLOptions extends QRCodeRenderersOptions {
|
||||
@@ -40,7 +40,7 @@ export interface QRCodeToDataURLOptions extends QRCodeRenderersOptions {
|
||||
};
|
||||
}
|
||||
|
||||
export interface QRCodeToStringOptions extends QRCodeOptions {
|
||||
export interface QRCodeToStringOptions extends QRCodeRenderersOptions {
|
||||
/**
|
||||
* Output format.
|
||||
* Default: utf8
|
||||
@@ -127,10 +127,6 @@ export interface QRCode {
|
||||
*/
|
||||
export function create(text: string | QRCodeSegment[], options: QRCodeOptions): QRCode;
|
||||
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
@@ -138,15 +134,11 @@ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCode
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions): Promise<any>;
|
||||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void;
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
@@ -154,15 +146,11 @@ export function toCanvas(text: string | QRCodeSegment[], callback: (error: Error
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions): Promise<any>;
|
||||
export function toCanvas(text: string | QRCodeSegment[], options?: QRCodeOptions): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to canvas.
|
||||
*/
|
||||
export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error, canvas: HTMLCanvasElement) => void): void;
|
||||
/**
|
||||
* Draws qr code symbol to node canvas.
|
||||
*/
|
||||
export function toCanvas(canvas: any, text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to node canvas.
|
||||
*/
|
||||
@@ -170,16 +158,12 @@ export function toCanvas(canvas: any, text: string | QRCodeSegment[], callback:
|
||||
/**
|
||||
* Draws qr code symbol to node canvas.
|
||||
*/
|
||||
export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions): Promise<any>;
|
||||
export function toCanvas(canvas: any, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise<any>;
|
||||
/**
|
||||
* Draws qr code symbol to node canvas.
|
||||
*/
|
||||
export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
@@ -187,15 +171,12 @@ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCod
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise<any>;
|
||||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeToDataURLOptions): Promise<any>;
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void;
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(text: string | QRCodeSegment[]): Promise<any>;
|
||||
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
@@ -203,17 +184,12 @@ export function toDataURL(text: string | QRCodeSegment[], callback: (error: Erro
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise<any>;
|
||||
export function toDataURL(text: string | QRCodeSegment[], options?: QRCodeToDataURLOptions): Promise<any>;
|
||||
/**
|
||||
* Returns a Data URI containing a representation of the QR Code image.
|
||||
*/
|
||||
export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void;
|
||||
|
||||
/**
|
||||
* Returns a string representation of the QR Code.
|
||||
* If choosen output format is svg it will returns a string containing xml code.
|
||||
*/
|
||||
export function toString(text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Returns a string representation of the QR Code.
|
||||
* If choosen output format is svg it will returns a string containing xml code.
|
||||
@@ -223,19 +199,13 @@ export function toString(text: string | QRCodeSegment[], callback: (error: Error
|
||||
* Returns a string representation of the QR Code.
|
||||
* If choosen output format is svg it will returns a string containing xml code.
|
||||
*/
|
||||
export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions): Promise<any>;
|
||||
export function toString(text: string | QRCodeSegment[], options?: QRCodeToStringOptions): Promise<any>;
|
||||
/**
|
||||
* Returns a string representation of the QR Code.
|
||||
* If choosen output format is svg it will returns a string containing xml code.
|
||||
*/
|
||||
export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions, callback: (error: Error, string: string) => void): void;
|
||||
|
||||
/**
|
||||
* Saves QR Code to image file.
|
||||
* If options.type is not specified, the format will be guessed from file extension.
|
||||
* Recognized extensions are png, svg, txt.
|
||||
*/
|
||||
export function toFile(path: string, text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Saves QR Code to image file.
|
||||
* If options.type is not specified, the format will be guessed from file extension.
|
||||
@@ -247,7 +217,7 @@ export function toFile(path: string, text: string | QRCodeSegment[], callback: (
|
||||
* If options.type is not specified, the format will be guessed from file extension.
|
||||
* Recognized extensions are png, svg, txt.
|
||||
*/
|
||||
export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions): Promise<any>;
|
||||
export function toFile(path: string, text: string | QRCodeSegment[], options?: QRCodeToFileOptions): Promise<any>;
|
||||
/**
|
||||
* Saves QR Code to image file.
|
||||
* If options.type is not specified, the format will be guessed from file extension.
|
||||
@@ -255,10 +225,6 @@ export function toFile(path: string, text: string | QRCodeSegment[], options: QR
|
||||
*/
|
||||
export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Writes QR Code image to stream. Only works with png format for now.
|
||||
*/
|
||||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[]): Promise<any>;
|
||||
/**
|
||||
* Writes QR Code image to stream. Only works with png format for now.
|
||||
*/
|
||||
@@ -266,7 +232,7 @@ export function toFileStream(stream: stream.Writable, text: string | QRCodeSegme
|
||||
/**
|
||||
* Writes QR Code image to stream. Only works with png format for now.
|
||||
*/
|
||||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options: QRCodeOptions): Promise<any>;
|
||||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options?: QRCodeOptions): Promise<any>;
|
||||
/**
|
||||
* Writes QR Code image to stream. Only works with png format for now.
|
||||
*/
|
||||
|
||||
@@ -2,31 +2,31 @@ import * as QRCode from 'qrcode';
|
||||
|
||||
const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
||||
|
||||
QRCode.toCanvas(canvas, 'sample text', function (error) {
|
||||
if (error) console.error(error)
|
||||
QRCode.toCanvas(canvas, 'sample text', (error) => {
|
||||
if (error) console.error(error);
|
||||
console.log('success!');
|
||||
});
|
||||
|
||||
QRCode.toDataURL('I am a pony!', function (err, url) {
|
||||
QRCode.toDataURL('I am a pony!', (err, url) => {
|
||||
console.log(url);
|
||||
});
|
||||
|
||||
QRCode.toDataURL('some text', { errorCorrectionLevel: 'H' }, function (err, url) {
|
||||
QRCode.toDataURL('some text', { errorCorrectionLevel: 'H' }, (err, url) => {
|
||||
console.log(url);
|
||||
});
|
||||
|
||||
QRCode.toDataURL('some text', { version: 2 }, function (err, url) {
|
||||
QRCode.toDataURL('some text', { version: 2 }, (err, url) => {
|
||||
console.log(url);
|
||||
});
|
||||
|
||||
QRCode.toDataURL([
|
||||
{ data: 'ABCDEFG', mode: 'alphanumeric' },
|
||||
{ data: '0123456', mode: 'numeric' }
|
||||
], function (err, url) {
|
||||
], (err, url) => {
|
||||
console.log(url);
|
||||
});
|
||||
|
||||
QRCode.toCanvas('text', { errorCorrectionLevel: 'H' }, function (err, canvas) {
|
||||
QRCode.toCanvas('text', { errorCorrectionLevel: 'H' }, (err, canvas) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -36,11 +36,11 @@ QRCode.toDataURL('text', {
|
||||
rendererOpts: {
|
||||
quality: 0.3
|
||||
}
|
||||
}, function (err, url) {
|
||||
}, (err, url) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
QRCode.toString('http://www.google.com', function (err, string) {
|
||||
QRCode.toString('http://www.google.com', (err, string) => {
|
||||
if (err) throw err;
|
||||
console.log(string);
|
||||
});
|
||||
@@ -50,7 +50,7 @@ QRCode.toFile('path/to/filename.png', 'Some text', {
|
||||
dark: '#00F', // Blue dots
|
||||
light: '#0000' // Transparent background
|
||||
}
|
||||
}, function (err) {
|
||||
}, (err) => {
|
||||
if (err) throw err;
|
||||
console.log('done');
|
||||
});
|
||||
|
||||
@@ -1,79 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
|
||||
+122
-62
@@ -1,71 +1,131 @@
|
||||
// Type definitions for react-calendar-timeline v0.8.1
|
||||
// Type definitions for react-calendar-timeline v0.16.3
|
||||
// Project: https://github.com/namespace-ee/react-calendar-timeline
|
||||
// Definitions by: Rajab Shakirov <https://github.com/radziksh>
|
||||
// Alex Maclean <https://github.com/acemac>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="react"/>
|
||||
|
||||
declare module "react-calendar-timeline" {
|
||||
interface ReactCalendarTimeline {
|
||||
groups: {
|
||||
id: number;
|
||||
title: any; // string | Element (React.ClassicComponentClass<any>);
|
||||
}[];
|
||||
items:{
|
||||
id: number;
|
||||
group: number;
|
||||
title?: any; // string | Element (React.ClassicComponentClass<any>);
|
||||
start_time: any;
|
||||
end_time: any;
|
||||
canMove?: boolean;
|
||||
canResize?: boolean;
|
||||
canChangeGroup?: boolean;
|
||||
className?: string;
|
||||
}[];
|
||||
keys?:{
|
||||
groupIdKey: string;
|
||||
groupTitleKey: string;
|
||||
itemIdKey: string;
|
||||
itemTitleKey: string;
|
||||
itemGroupKey: string;
|
||||
itemTimeStartKey: string;
|
||||
itemTimeEndKey: string;
|
||||
};
|
||||
sidebarWidth?: number;
|
||||
dragSnap?: number;
|
||||
minResizeWidth?: number;
|
||||
fixedHeader?: "fixed" | "none";
|
||||
zIndexStart?: number;
|
||||
lineHeight?: number;
|
||||
headerLabelGroupHeight?: number;
|
||||
headerLabelHeight?: number;
|
||||
itemHeightRatio?: number;
|
||||
minZoom?: number;
|
||||
maxZoom?: number;
|
||||
canMove?: boolean;
|
||||
canChangeGroup?: boolean;
|
||||
canResize?: boolean;
|
||||
useResizeHandle?: boolean;
|
||||
stackItems?: boolean;
|
||||
traditionalZoom?: boolean;
|
||||
itemTouchSendsClick?: boolean;
|
||||
onItemMove?(itemId:any, dragTime:any, newGroupOrder:any): any;
|
||||
onItemResize?(itemId:any, newResizeEnd:any): any;
|
||||
onItemSelect?(itemId:any): any;
|
||||
onItemClick?(itemId:any): any;
|
||||
onCanvasClick?(groupId:any, time:any, e:any): any;
|
||||
onItemDoubleClick?(itemId:any): any;
|
||||
moveResizeValidator?(action:any, itemId:any, time:any): any;
|
||||
defaultTimeStart?: any;
|
||||
defaultTimeEnd?: any;
|
||||
visibleTimeStart?: number;
|
||||
visibleTimeEnd?: number;
|
||||
onTimeChange?(visibleTimeStart:any, visibleTimeEnd:any): any;
|
||||
onTimeInit?(visibleTimeStart:any, visibleTimeEnd:any): any;
|
||||
onBoundsChange?(canvasTimeStart:any, canvasTimeEnd:any): any;
|
||||
children?: any;
|
||||
}
|
||||
let ReactCalendarTimeline : React.ClassicComponentClass<ReactCalendarTimeline>;
|
||||
export default ReactCalendarTimeline;
|
||||
|
||||
export interface TimelineGroup {
|
||||
id: number;
|
||||
title: React.ReactNode;
|
||||
rightTitle?: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface TimelineItem {
|
||||
id: number;
|
||||
group: number;
|
||||
title?: React.ReactNode;
|
||||
start_time: any;
|
||||
end_time: any;
|
||||
canMove?: boolean;
|
||||
canResize?: boolean | "left" | "right" | "both";
|
||||
canChangeGroup?: boolean;
|
||||
className?: string;
|
||||
itemProps?: {};
|
||||
}
|
||||
|
||||
export interface TimelineContext {
|
||||
visibletimeStart: number,
|
||||
visibleTimeEnd: number,
|
||||
timelineWidth: number
|
||||
}
|
||||
|
||||
export interface TimelineTimeSteps {
|
||||
second: number,
|
||||
minute: number,
|
||||
hour: number,
|
||||
day: number,
|
||||
month: number,
|
||||
year: number
|
||||
}
|
||||
|
||||
export interface TimelineHeaderLabelFormat {
|
||||
yearShort: string,
|
||||
yearLong: string,
|
||||
monthShort: string,
|
||||
monthMedium: string,
|
||||
monthMediumLong: string,
|
||||
monthLong: string,
|
||||
dayShort: string,
|
||||
dayLong: string,
|
||||
hourShort: string,
|
||||
hourMedium: string,
|
||||
hourMediumLong: string,
|
||||
hourLong: string,
|
||||
time: string
|
||||
}
|
||||
|
||||
export interface ReactCalendarTimelineProps {
|
||||
groups: TimelineGroup[];
|
||||
items: TimelineItem[];
|
||||
keys?:{
|
||||
groupIdKey: string;
|
||||
groupTitleKey: string;
|
||||
itemIdKey: string;
|
||||
itemTitleKey: string;
|
||||
itemGroupKey: string;
|
||||
itemTimeStartKey: string;
|
||||
itemTimeEndKey: string;
|
||||
};
|
||||
defaultTimeStart?: any;
|
||||
defaultTimeEnd?: any;
|
||||
visibleTimeStart?: any;
|
||||
visibleTimeEnd?: any;
|
||||
selected?: number[];
|
||||
sidebarWidth?: number;
|
||||
sidebarContent?: React.ReactNode;
|
||||
rightSidebarWidth?: number;
|
||||
rightSidebarContent?: React.ReactNode;
|
||||
dragSnap?: number;
|
||||
minResizeWidth?: number;
|
||||
stickyOffset?: number;
|
||||
stickyHeader?: boolean;
|
||||
headerRef?: any;
|
||||
lineHeight?: number;
|
||||
headerLabelGroupHeight?: number;
|
||||
headerLabelHeight?: number;
|
||||
itemHeightRatio?: number;
|
||||
minZoom?: number;
|
||||
maxZoom?: number;
|
||||
clickTolerance?: number;
|
||||
canMove?: boolean;
|
||||
canChangeGroup?: boolean;
|
||||
canResize?: boolean | "left" | "right" | "both";
|
||||
useResizeHandle?: boolean;
|
||||
showCursorLine?: boolean;
|
||||
stackItems?: boolean;
|
||||
traditionalZoom?: boolean;
|
||||
itemTouchSendsClick?: boolean;
|
||||
timeSteps?: TimelineTimeSteps,
|
||||
onItemMove?(itemId: number, dragTime: number, newGroupOrder: number): any;
|
||||
onItemResize?(itemId: number, newResizeEnd: number, edge: "left" | "right"): any;
|
||||
onItemSelect?(itemId: number, e: any, time: number): any;
|
||||
onItemClick?(itemId: number, e: any, time: number): any;
|
||||
onItemDoubleClick?(itemId: number, e: any, time: number): any;
|
||||
onCanvasClick?(groupId:number, time:number, e:any): any;
|
||||
onCanvasDoubleClick?(group: TimelineGroup, time: number, e: any): any;
|
||||
onCanvasContextMenu?(group: TimelineGroup, time: number, e: any): any;
|
||||
onZoom?(timelineContext: TimelineContext): any;
|
||||
moveResizeValidator?(action:"move" | "resize", itemId: number, time: number, resizeEdge: "left" | "right"): any;
|
||||
headerLabelFormats?: TimelineHeaderLabelFormat,
|
||||
subHeaderLabelFormats?: TimelineHeaderLabelFormat,
|
||||
onTimeChange?(visibleTimeStart: number, visibleTimeEnd: number, updateScrollCanvas: (start: number, end: number) => void): any;
|
||||
onTimeInit?(canvasTimeStart: number, canvasTimeEnd: number): any;
|
||||
onBoundsChange?(canvasTimeStart: number, canvasTimeEnd: number): any;
|
||||
itemRenderer?: (props: {item: TimelineItem, context: TimelineContext}) => React.ReactElement<{}>;
|
||||
groupRenderer?: (props: {group: TimelineGroup, isRightSidebar: boolean}) => React.ReactElement<{}>;
|
||||
minimumWidthForItemContentVisibility?: number;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
export const defaultHeaderLabelFormats: TimelineHeaderLabelFormat;
|
||||
export const defaultSubHeaderLabelFormats: TimelineHeaderLabelFormat;
|
||||
|
||||
let ReactCalendarTimeline : React.ClassicComponentClass<ReactCalendarTimelineProps>;
|
||||
export default ReactCalendarTimeline;
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -137,6 +137,7 @@ export interface AuthorizeParams {
|
||||
nonce?: string;
|
||||
audience?: string;
|
||||
scope?: string;
|
||||
connection?: string;
|
||||
}
|
||||
|
||||
export interface ClearSessionParams {
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ export interface DatePickerProps {
|
||||
placeholder?: string;
|
||||
modalOnResponderTerminationRequest?(e: any): boolean;
|
||||
is24Hour?: boolean;
|
||||
getDateStr?: (date: Date) => string;
|
||||
style?: any;
|
||||
customStyles?: any;
|
||||
minuteInterval?: number;
|
||||
|
||||
+15
-7
@@ -1,11 +1,18 @@
|
||||
// Type definitions for react-native-material-textfield 0.12
|
||||
// Project: https://github.com/n4kz/react-native-material-textfield
|
||||
// Definitions by: Ville Venäläinen <https://github.com/mindhivefi>
|
||||
// Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from 'react';
|
||||
import { TextInputProps, TextStyle, ViewStyle, View } from 'react-native';
|
||||
import {
|
||||
StyleProp,
|
||||
TextInputProps,
|
||||
TextStyle,
|
||||
ViewStyle,
|
||||
View
|
||||
} from 'react-native';
|
||||
|
||||
export interface TextFieldProps extends TextInputProps {
|
||||
animationDuration?: number;
|
||||
@@ -17,9 +24,10 @@ export interface TextFieldProps extends TextInputProps {
|
||||
labelPadding?: number;
|
||||
inputContainerPadding?: number;
|
||||
|
||||
labelTextStyle?: TextStyle;
|
||||
titleTextStyle?: TextStyle;
|
||||
affixTextStyle?: TextStyle;
|
||||
style?: StyleProp<TextStyle>;
|
||||
labelTextStyle?: StyleProp<TextStyle>;
|
||||
titleTextStyle?: StyleProp<TextStyle>;
|
||||
affixTextStyle?: StyleProp<TextStyle>;
|
||||
|
||||
tintColor?: string;
|
||||
textColor?: string;
|
||||
@@ -47,8 +55,8 @@ export interface TextFieldProps extends TextInputProps {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
|
||||
containerStyle?: ViewStyle;
|
||||
inputContainerStyle?: ViewStyle;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
inputContainerStyle?: StyleProp<ViewStyle>;
|
||||
|
||||
onPress?(event: Event): void;
|
||||
onChangeText?(text: string): void;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import { View, Text } from 'react-native';
|
||||
import { View } from 'react-native';
|
||||
import { TextField } from 'react-native-material-textfield';
|
||||
|
||||
const Example = () =>
|
||||
const Example = () => (
|
||||
<View>
|
||||
<TextField
|
||||
label="Example"
|
||||
multiline
|
||||
placeholder="Text when field is empty"
|
||||
value="Initial value"
|
||||
style={{ fontSize: 10 }}
|
||||
/>
|
||||
</View>;
|
||||
</View>
|
||||
);
|
||||
|
||||
+4
@@ -45,6 +45,10 @@ export interface CarouselProps<T> extends React.Props<ScrollViewProps> {
|
||||
* Width in pixels of your slides, must be the same for all of them
|
||||
* Note: Required with horizontal carousel
|
||||
*/
|
||||
/**
|
||||
* Reverses the direction of scroll. Uses scale transforms of -1.
|
||||
*/
|
||||
inverted?: boolean;
|
||||
itemWidth?: number;
|
||||
/**
|
||||
* Height in pixels of carousel's items, must be the same for all of them
|
||||
|
||||
Vendored
+8
-2
@@ -1078,6 +1078,12 @@ export type ReturnKeyTypeAndroid = "none" | "previous";
|
||||
export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call";
|
||||
export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS
|
||||
|
||||
export interface TextInputFocusEventData {
|
||||
target: number,
|
||||
text: string,
|
||||
eventCount: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/textinput.html#props
|
||||
*/
|
||||
@@ -1159,7 +1165,7 @@ export interface TextInputProps
|
||||
/**
|
||||
* Callback that is called when the text input is blurred
|
||||
*/
|
||||
onBlur?: () => void;
|
||||
onBlur?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input's text changes.
|
||||
@@ -1198,7 +1204,7 @@ export interface TextInputProps
|
||||
/**
|
||||
* Callback that is called when the text input is focused
|
||||
*/
|
||||
onFocus?: () => void;
|
||||
onFocus?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input selection is changed.
|
||||
|
||||
@@ -49,8 +49,10 @@ import {
|
||||
NativeModules,
|
||||
MaskedViewIOS,
|
||||
TextInput,
|
||||
TextInputFocusEventData,
|
||||
InputAccessoryView,
|
||||
StatusBar
|
||||
StatusBar,
|
||||
NativeSyntheticEvent
|
||||
} from "react-native";
|
||||
|
||||
declare module "react-native" {
|
||||
@@ -447,6 +449,25 @@ class TextInputRefTest extends React.Component<{}, {username: string}> {
|
||||
}
|
||||
}
|
||||
|
||||
class TextInputFocusBlurEventTest extends React.Component {
|
||||
handleOnBlur(e: NativeSyntheticEvent<TextInputFocusEventData>) {
|
||||
}
|
||||
|
||||
handleOnFocus(e: NativeSyntheticEvent<TextInputFocusEventData>) {
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
onBlur={(e: NativeSyntheticEvent<TextInputFocusEventData>) => this.handleOnBlur(e)}
|
||||
onFocus={(e: NativeSyntheticEvent<TextInputFocusEventData>) => this.handleOnFocus(e)}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class StatusBarTest extends React.Component {
|
||||
render() {
|
||||
StatusBar.setBarStyle("dark-content", true);
|
||||
|
||||
Vendored
+5
@@ -130,6 +130,11 @@ export class InsufficientStorageError extends DefinedHttpError { }
|
||||
export class BandwidthLimitExceededError extends DefinedHttpError { }
|
||||
export class NotExtendedError extends DefinedHttpError { }
|
||||
export class NetworkAuthenticationRequiredError extends DefinedHttpError { }
|
||||
export class PayloadTooLargeError extends DefinedHttpError { }
|
||||
export class UriTooLongError extends DefinedHttpError { }
|
||||
export class MisdirectedRequestError extends DefinedHttpError { }
|
||||
export class UnavailableForLegalReasonsError extends DefinedHttpError { }
|
||||
export class LoopDetectedError extends DefinedHttpError { }
|
||||
|
||||
export class BadDigestError extends DefinedRestError { }
|
||||
export class BadMethodError extends DefinedRestError { }
|
||||
|
||||
@@ -62,6 +62,12 @@ httpError = new restifyErrors.InsufficientStorageError();
|
||||
httpError = new restifyErrors.BandwidthLimitExceededError();
|
||||
httpError = new restifyErrors.NotExtendedError();
|
||||
httpError = new restifyErrors.NetworkAuthenticationRequiredError();
|
||||
httpError = new restifyErrors.PayloadTooLargeError();
|
||||
httpError = new restifyErrors.UriTooLongError();
|
||||
httpError = new restifyErrors.MisdirectedRequestError();
|
||||
httpError = new restifyErrors.UnavailableForLegalReasonsError();
|
||||
httpError = new restifyErrors.LoopDetectedError();
|
||||
httpError = new restifyErrors.NetworkAuthenticationRequiredError();
|
||||
|
||||
// RestErrors
|
||||
let restError = new restifyErrors.BadDigestError();
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// Type definitions for rolling-rate-limiter 0.1
|
||||
// Project: https://github.com/peterkhayes/rolling-rate-limiter
|
||||
// Definitions by: Jonas Lochmann <https://github.com/l-jonas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = RollingRateLimiter;
|
||||
|
||||
declare function RollingRateLimiter(options: RollingRateLimiter.InMemoryOptions): RollingRateLimiter.SyncOrAsyncLimiter;
|
||||
declare function RollingRateLimiter(options: RollingRateLimiter.WithRedisOptions): RollingRateLimiter.AsyncLimiter;
|
||||
|
||||
declare namespace RollingRateLimiter {
|
||||
interface GeneralOptions {
|
||||
interval: number;
|
||||
maxInInterval: number;
|
||||
minDifference?: number;
|
||||
}
|
||||
|
||||
interface WithRedisOptions extends GeneralOptions {
|
||||
redis: CompatibleRedisClient;
|
||||
namespace?: string;
|
||||
}
|
||||
|
||||
interface CompatibleRedisClient {
|
||||
multi: () => any;
|
||||
}
|
||||
|
||||
type InMemoryOptions = GeneralOptions;
|
||||
|
||||
type AsyncLimiterWithToken = (token: string, callback: AsyncLimiterCallback) => void;
|
||||
type AsyncLimiterWithoutToken = (callback: AsyncLimiterCallback) => void;
|
||||
type AsyncLimiterCallback = (err: any, timeLeft: number, actionsLeft: number) => void;
|
||||
type AsyncLimiter = AsyncLimiterWithToken & AsyncLimiterWithToken;
|
||||
|
||||
type SyncLimiter = (token?: string) => number;
|
||||
|
||||
type SyncOrAsyncLimiter = SyncLimiter & AsyncLimiter;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import * as RateLimiter from 'rolling-rate-limiter';
|
||||
|
||||
/*
|
||||
Setup:
|
||||
*/
|
||||
|
||||
const limiter = RateLimiter({
|
||||
// in miliseconds
|
||||
interval: 1000,
|
||||
maxInInterval: 10,
|
||||
// optional: the minimum time (in miliseconds) between any two actions
|
||||
minDifference: 100
|
||||
});
|
||||
|
||||
/*
|
||||
Action:
|
||||
*/
|
||||
|
||||
function attemptAction(userId: string) {
|
||||
// Argument should be a unique identifier for a user if one exists.
|
||||
// If none is provided, the limiter will not differentiate between users.
|
||||
const timeLeft = limiter(userId);
|
||||
|
||||
if (timeLeft > 0) {
|
||||
// limit was exceeded, action should not be allowed
|
||||
// timeLeft is the number of ms until the next action will be allowed
|
||||
// note that this can be treated as a boolean, since 0 is falsy
|
||||
} else {
|
||||
// limit was not exceeded, action should be allowed
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Note that the in-memory version can also operate asynchronously.
|
||||
The syntax is identical to the redis implementation below.
|
||||
*/
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rolling-rate-limiter-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+169
-38
@@ -8,6 +8,7 @@
|
||||
// Kyle Kamperschroer <https://github.com/kkamperschroer>
|
||||
// Kensuke Hoshikawa <https://github.com/starhoshi>
|
||||
// Thomas Bruun <https://github.com/bruun>
|
||||
// Gal Talmor <https://github.com/galtalmor>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -481,7 +482,7 @@ declare namespace Stripe {
|
||||
/**
|
||||
* ID of the Connect Application that earned the fee. [Expandable]
|
||||
*/
|
||||
application: string; //TODO: Implement IApplication interface and reference type here for expansion:- "string | IApplication"
|
||||
application: string | applications.IApplication;
|
||||
|
||||
/**
|
||||
* Balance transaction that describes the impact of this collected application
|
||||
@@ -737,12 +738,17 @@ declare namespace Stripe {
|
||||
* charge if a partial refund was issued), positive integer or zero.
|
||||
*/
|
||||
amount_refunded: number;
|
||||
|
||||
/**
|
||||
* ID of the Connect application that created the charge. [Expandable]
|
||||
*/
|
||||
application?: string | applications.IApplication | null;
|
||||
|
||||
/**
|
||||
* The application fee (if any) for the charge. See the Connect documentation
|
||||
* for details. [Expandable]
|
||||
*/
|
||||
application_fee?: string | applicationFees.IApplicationFee;
|
||||
application_fee?: string | applicationFees.IApplicationFee | null;
|
||||
|
||||
/**
|
||||
* ID of the balance transaction that describes the impact of this charge on
|
||||
@@ -767,25 +773,33 @@ declare namespace Stripe {
|
||||
/**
|
||||
* ID of the customer this charge is for if one exists. [Expandable]
|
||||
*/
|
||||
customer: string | customers.ICustomer;
|
||||
customer: string | customers.ICustomer | null;
|
||||
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The account (if any) the charge was made on behalf of, with an automatic
|
||||
* transfer. See the [Connect documentation]
|
||||
* <https://stripe.com/docs/connect/destination-charges> for details.
|
||||
* [Expandable]
|
||||
*/
|
||||
destination?: string | accounts.IAccount | null;
|
||||
|
||||
/**
|
||||
* Details about the dispute if the charge has been disputed.
|
||||
*/
|
||||
dispute?: disputes.IDispute;
|
||||
dispute?: disputes.IDispute | null;
|
||||
|
||||
/**
|
||||
* Error code explaining reason for charge failure if available (see the errors section for a list of
|
||||
* codes: https://stripe.com/docs/api#errors).
|
||||
*/
|
||||
failure_code: string;
|
||||
failure_code: string | null;
|
||||
|
||||
/**
|
||||
* Message to user further explaining reason for charge failure if available.
|
||||
*/
|
||||
failure_message: string;
|
||||
failure_message: string | null;
|
||||
|
||||
/**
|
||||
* Hash with information on fraud assessments for the charge.
|
||||
@@ -805,16 +819,30 @@ declare namespace Stripe {
|
||||
/**
|
||||
* ID of the invoice this charge is for if one exists. [Expandable]
|
||||
*/
|
||||
invoice: string | invoices.IInvoice;
|
||||
invoice: string | invoices.IInvoice | null;
|
||||
|
||||
livemode: boolean;
|
||||
|
||||
metadata: IMetadata;
|
||||
|
||||
/**
|
||||
* The Stripe account ID for which these funds are intended. Automatically
|
||||
* set if you use the destination parameter. For details, see [Creating
|
||||
* Separate Charges and Transfers]
|
||||
* <https://stripe.com/docs/connect/charges-transfers#on-behalf-of>.
|
||||
*/
|
||||
on_behalf_of?: string | null;
|
||||
|
||||
/**
|
||||
* ID of the order this charge is for if one exists. [Expandable]
|
||||
*/
|
||||
order: string | orders.IOrder;
|
||||
order: string | orders.IOrder | null;
|
||||
|
||||
/**
|
||||
* Details about whether the payment was accepted, and why. See
|
||||
* understanding declines for details. [Expandable]
|
||||
*/
|
||||
outcome?: charges.IOutcome;
|
||||
|
||||
/**
|
||||
* true if the charge succeeded, or was successfully authorized for later capture.
|
||||
@@ -824,12 +852,12 @@ declare namespace Stripe {
|
||||
/**
|
||||
* This is the email address that the receipt for this charge was sent to.
|
||||
*/
|
||||
receipt_email: string;
|
||||
receipt_email: string | null;
|
||||
|
||||
/**
|
||||
* This is the transaction number that appears on email receipts sent for this charge.
|
||||
*/
|
||||
receipt_number: string;
|
||||
receipt_number: string | null;
|
||||
|
||||
/**
|
||||
* Whether or not the charge has been fully refunded. If the charge is only partially refunded,
|
||||
@@ -842,10 +870,15 @@ declare namespace Stripe {
|
||||
*/
|
||||
refunds: IChargeRefunds;
|
||||
|
||||
/**
|
||||
* ID of the review associated with this charge if one exists. [Expandable]
|
||||
*/
|
||||
review?: string | reviews.IReview | null;
|
||||
|
||||
/**
|
||||
* Shipping information for the charge.
|
||||
*/
|
||||
shipping?: IShippingInformation;
|
||||
shipping?: IShippingInformation | null;
|
||||
|
||||
/**
|
||||
* For most Stripe users, the source of every charge is a credit or debit card.
|
||||
@@ -858,13 +891,13 @@ declare namespace Stripe {
|
||||
* from another Stripe account. See the Connect documentation for details.
|
||||
* [Expandable]
|
||||
*/
|
||||
source_transfer: string | transfers.ITransfer;
|
||||
source_transfer: string | transfers.ITransfer | null;
|
||||
|
||||
/**
|
||||
* Extra information about a charge. This will appear on your customer’s
|
||||
* credit card statement.
|
||||
*/
|
||||
statement_descriptor: string;
|
||||
statement_descriptor: string | null;
|
||||
|
||||
/**
|
||||
* The status of the payment is either "succeeded", "pending", or "failed".
|
||||
@@ -875,7 +908,15 @@ declare namespace Stripe {
|
||||
* ID of the transfer to the destination account (only applicable if the
|
||||
* charge was created using the destination parameter). [Expandable]
|
||||
*/
|
||||
transfer: string | transfers.ITransfer;
|
||||
transfer?: string | transfers.ITransfer;
|
||||
|
||||
/**
|
||||
* A string that identifies this transaction as part of a group.
|
||||
* See the [Connect documentation]
|
||||
* <https://stripe.com/docs/connect/charges-transfers#grouping-transactions>
|
||||
* for details.
|
||||
*/
|
||||
transfer_group?: string | null;
|
||||
}
|
||||
|
||||
interface IChargeCreationOptions extends IDataOptionsWithMetadata {
|
||||
@@ -1056,6 +1097,48 @@ declare namespace Stripe {
|
||||
}
|
||||
}
|
||||
|
||||
interface IOutcome {
|
||||
/**
|
||||
* The value reversed_after_approval indicates the payment was blocked by Stripe after
|
||||
* bank authorization, and may temporarily appear as “pending” on a cardholder’s statement.
|
||||
*/
|
||||
network_status: "approved_by_network" | "declined_by_network" | "not_sent_to_network" | "reversed_after_approval";
|
||||
|
||||
/**
|
||||
* An enumerated value providing a more detailed explanation of the outcome’s type. Charges
|
||||
* blocked by Radar’s default block rule have the value highest_risk_level. Charges placed
|
||||
* in review by Radar’s default review rule have the value elevated_risk_level. Charges
|
||||
* authorized, blocked, or placed in review by custom rules have the value rule. See
|
||||
* understanding declines for more details.
|
||||
*/
|
||||
reason: string | null;
|
||||
|
||||
/**
|
||||
* Stripe’s evaluation of the riskiness of the payment. Possible values for evaluated
|
||||
* payments are normal, elevated, highest. For non-card payments, and card-based payments
|
||||
* predating the public assignment of risk levels, this field will have the value not_assessed.
|
||||
* In the event of an error in the evaluation, this field will have the value unknown.
|
||||
*/
|
||||
risk_level?: string | null;
|
||||
|
||||
/**
|
||||
* The ID of the Radar rule that matched the payment, if applicable. [Expandable]
|
||||
*/
|
||||
rule?: string | string[] | null;
|
||||
|
||||
/**
|
||||
* See [understanding declines]<https://stripe.com/docs/declines> and
|
||||
* [Radar reviews]<https://stripe.com/docs/radar/review> for details.
|
||||
*/
|
||||
type: "authorized" | "manual_review" | "issuer_declined" | "blocked" | "invalid";
|
||||
|
||||
/**
|
||||
* A human-readable description of the outcome type and reason, designed for you (the
|
||||
* recipient of the payment), not your customer.
|
||||
*/
|
||||
seller_message: string;
|
||||
}
|
||||
|
||||
interface IChargeRefunds extends IList<refunds.IRefund>, resources.ChargeRefunds { }
|
||||
}
|
||||
|
||||
@@ -4092,7 +4175,7 @@ declare namespace Stripe {
|
||||
* in the card object if the card belongs to an account or recipient
|
||||
* instead.
|
||||
*/
|
||||
customer?: string | customers.ICustomer;
|
||||
customer?: string | customers.ICustomer | null;
|
||||
|
||||
/**
|
||||
* Only applicable on accounts (not customers or recipients). This
|
||||
@@ -4126,7 +4209,7 @@ declare namespace Stripe {
|
||||
/**
|
||||
* The card number
|
||||
*/
|
||||
number: string;
|
||||
number?: string;
|
||||
|
||||
/**
|
||||
* Card brand. Can be Visa, American Express, MasterCard, Discover, JCB, Diners Club, or Unknown.
|
||||
@@ -4140,20 +4223,20 @@ declare namespace Stripe {
|
||||
*/
|
||||
funding: "credit" | "debit" | "prepaid" | "unknown";
|
||||
last4: string;
|
||||
address_city: string;
|
||||
address_city: string | null;
|
||||
|
||||
/**
|
||||
* Billing address country, if provided when creating card
|
||||
*/
|
||||
address_country: string;
|
||||
address_line1: string;
|
||||
address_country: string | null;
|
||||
address_line1: string | null;
|
||||
|
||||
/**
|
||||
* If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked.
|
||||
*/
|
||||
address_line1_check: string;
|
||||
address_line2: string;
|
||||
address_state: string;
|
||||
address_line1_check: string | null;
|
||||
address_line2: string | null;
|
||||
address_state: string | null;
|
||||
address_zip: string;
|
||||
|
||||
/**
|
||||
@@ -4175,7 +4258,7 @@ declare namespace Stripe {
|
||||
/**
|
||||
* (For Apple Pay integrations only.) The last four digits of the device account number.
|
||||
*/
|
||||
dynamic_last4: string;
|
||||
dynamic_last4: string | null;
|
||||
|
||||
/**
|
||||
* Cardholder name
|
||||
@@ -4194,7 +4277,7 @@ declare namespace Stripe {
|
||||
* If the card number is tokenized, this is the method that was
|
||||
* used. Can be "apple_pay" or "android_pay".
|
||||
*/
|
||||
tokenization_method: "apple_pay" | "android_pay";
|
||||
tokenization_method: "apple_pay" | "android_pay" | null;
|
||||
}
|
||||
|
||||
interface ICardUpdateOptions extends IDataOptionsWithMetadata {
|
||||
@@ -4944,6 +5027,54 @@ declare namespace Stripe {
|
||||
}
|
||||
}
|
||||
|
||||
namespace reviews {
|
||||
interface IReview extends IResourceObject {
|
||||
/**
|
||||
* String representing the object’s type. Objects of the same type share the same value.
|
||||
*/
|
||||
object: "review";
|
||||
|
||||
/**
|
||||
* The charge associated with this review. [Expandable]
|
||||
*/
|
||||
charge: string | charges.ICharge;
|
||||
|
||||
/**
|
||||
* Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
*/
|
||||
created: number;
|
||||
|
||||
/**
|
||||
* Has the value true if the object exists in live mode or the value false if the object exists in test mode.
|
||||
*/
|
||||
livemode: boolean;
|
||||
|
||||
/**
|
||||
* If true, the review needs action.
|
||||
*/
|
||||
open: boolean;
|
||||
|
||||
/**
|
||||
* The reason the review is currently open or closed.
|
||||
*/
|
||||
reason: "rule" | "manual" | "approved" | "refunded" | "refunded_as_fraud" | "disputed";
|
||||
}
|
||||
}
|
||||
|
||||
namespace applications {
|
||||
interface IApplication extends IResourceObject {
|
||||
/**
|
||||
* String representing the object’s type. Objects of the same type share the same value.
|
||||
*/
|
||||
object: "application";
|
||||
|
||||
/**
|
||||
* String representing the application’s name.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
class StripeResource {
|
||||
constructor(stripe: Stripe, urlData: any);
|
||||
}
|
||||
@@ -5388,18 +5519,18 @@ declare namespace Stripe {
|
||||
* Once entirely refunded, a charge can't be refunded again.
|
||||
* This method will throw an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
|
||||
*/
|
||||
create(data: refunds.IRefundCreationOptions, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create(data: refunds.IRefundCreationOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create(options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create(response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create?(data: refunds.IRefundCreationOptions, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create?(data: refunds.IRefundCreationOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create?(options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
create?(response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
|
||||
/**
|
||||
* Retrieves the details of an existing refund.
|
||||
*/
|
||||
retrieve(id: string, data: IDataOptions, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve(id: string, data: IDataOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve(id: string, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve(id: string, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve?(id: string, data: IDataOptions, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve?(id: string, data: IDataOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve?(id: string, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
retrieve?(id: string, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -5408,18 +5539,18 @@ declare namespace Stripe {
|
||||
*
|
||||
* This request only accepts metadata as an argument.
|
||||
*/
|
||||
update(id: string, data: IDataOptionsWithMetadata, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
update(id: string, data: IDataOptionsWithMetadata, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
update?(id: string, data: IDataOptionsWithMetadata, options: HeaderOptions, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
update?(id: string, data: IDataOptionsWithMetadata, response?: IResponseFn<refunds.IRefund>): Promise<refunds.IRefund>;
|
||||
|
||||
/**
|
||||
* Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order,
|
||||
* with the most recent refunds appearing first.
|
||||
* For convenience, the 10 most recent refunds are always available by default on the charge object.
|
||||
*/
|
||||
list(data: refunds.IRefundListOptions, options: HeaderOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list(data: refunds.IRefundListOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list(options: HeaderOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list(response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list?(data: refunds.IRefundListOptions, options: HeaderOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list?(data: refunds.IRefundListOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list?(options: HeaderOptions, response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
list?(response?: IResponseFn<IList<refunds.IRefund>>): Promise<IList<refunds.IRefund>>;
|
||||
}
|
||||
|
||||
class Coupons extends StripeResource {
|
||||
|
||||
Reference in New Issue
Block a user