mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
resolve merge conflict
This commit is contained in:
@@ -156,12 +156,6 @@
|
||||
"sourceRepoURL": "https://github.com/brianloveswords/base64url",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "better-scroll",
|
||||
"typingsPackageName": "better-scroll",
|
||||
"sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll",
|
||||
"asOfVersion": "1.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "BigInteger.js",
|
||||
"typingsPackageName": "big-integer",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "definitely-typed",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import BScroll from 'better-scroll';
|
||||
|
||||
const BScroll1 = new BScroll('#wrapper');
|
||||
const BScroll2 = new BScroll('#wrapper', { scrollX: false, scrollY: false });
|
||||
const BScroll3 = new BScroll('#wrapper', {
|
||||
snap: true,
|
||||
wheel: false,
|
||||
scrollbar: false,
|
||||
pullDownRefresh: false,
|
||||
});
|
||||
const BScroll4 = new BScroll('#wrapper', {
|
||||
wheel: {
|
||||
selectedIndex: 0,
|
||||
},
|
||||
});
|
||||
const BScroll6 = new BScroll('#wrapper', {
|
||||
snap: {
|
||||
loop: false,
|
||||
el: document.querySelector('div-test') as Element,
|
||||
threshold: 0.1,
|
||||
stepX: 100,
|
||||
stepY: 100,
|
||||
listenFlick: true,
|
||||
},
|
||||
});
|
||||
const BScroll7 = new BScroll('#wrapper', {
|
||||
scrollbar: {
|
||||
fade: true,
|
||||
},
|
||||
});
|
||||
|
||||
const BScroll8 = new BScroll('#wrapper', {
|
||||
pullDownRefresh: {
|
||||
threshold: 50,
|
||||
stop: 20,
|
||||
},
|
||||
});
|
||||
|
||||
BScroll1.refresh();
|
||||
BScroll1.scrollTo(0, 100);
|
||||
BScroll1.scrollTo(0, 100, 200);
|
||||
|
||||
BScroll1.scrollToElement('selectedElement');
|
||||
BScroll1.scrollToElement('selectedElement', 250);
|
||||
|
||||
BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement);
|
||||
BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement, 250);
|
||||
|
||||
BScroll2.on('scrollStart', () => { console.log('scroll started'); });
|
||||
|
||||
const BScroll9 = new BScroll(document.getElementById('wrapper') as HTMLElement);
|
||||
const BScroll10 = new BScroll(document.getElementById('wrapper') as HTMLElement, { freeScroll: true });
|
||||
const BScroll11 = new BScroll(document.getElementById('wrapper') as HTMLElement, {
|
||||
preventDefaultException: {
|
||||
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/,
|
||||
},
|
||||
});
|
||||
const BScroll12 = new BScroll(document.getElementById('wrapper') as HTMLElement, {
|
||||
preventDefaultException: {
|
||||
className: /(^|\s)test(\s|$)/,
|
||||
},
|
||||
});
|
||||
|
||||
const BScroll13 = new BScroll(document.getElementById('wrapper') as HTMLElement, {
|
||||
swipeBounceTime: 1000,
|
||||
});
|
||||
|
||||
const BScroll14 = new BScroll('#wrapper', { disableMouse: true, disableTouch: false });
|
||||
Vendored
+238
@@ -0,0 +1,238 @@
|
||||
// Type definitions for better-scroll 1.12
|
||||
// Project: https://github.com/ustbhuangyi/better-scroll
|
||||
// Definitions by: cloudstone <https://github.com/stoneChen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.2
|
||||
export interface WheelOption {
|
||||
selectedIndex: number;
|
||||
rotate: number;
|
||||
adjustTime: number;
|
||||
wheelWrapperClass: string;
|
||||
wheelItemClass: string;
|
||||
}
|
||||
|
||||
export interface PageOption {
|
||||
x: number;
|
||||
y: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
}
|
||||
|
||||
export interface SlideOption {
|
||||
loop: boolean;
|
||||
el: Element;
|
||||
threshold: number;
|
||||
stepX: number;
|
||||
stepY: number;
|
||||
speed: number;
|
||||
listenFlick: boolean;
|
||||
}
|
||||
|
||||
export interface ScrollBarOption {
|
||||
fade: boolean;
|
||||
}
|
||||
|
||||
export interface PullDownOption {
|
||||
threshold: number;
|
||||
stop: number;
|
||||
}
|
||||
|
||||
export interface PullUpOption {
|
||||
threshold: number;
|
||||
}
|
||||
|
||||
export interface BounceObjectOption {
|
||||
top?: boolean;
|
||||
bottom?: boolean;
|
||||
left?: boolean;
|
||||
right?: boolean;
|
||||
}
|
||||
|
||||
export interface EaseOption {
|
||||
swipe?: {
|
||||
style: string;
|
||||
fn: (t: number) => number;
|
||||
};
|
||||
swipeBounce?: {
|
||||
style: string;
|
||||
fn: (t: number) => number;
|
||||
};
|
||||
bounce?: {
|
||||
style: string;
|
||||
fn: (t: number) => number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BsOption {
|
||||
startX: number;
|
||||
startY: number;
|
||||
scrollX: boolean;
|
||||
scrollY: boolean;
|
||||
freeScroll: boolean;
|
||||
directionLockThreshold: number;
|
||||
eventPassthrough: string | boolean;
|
||||
click: boolean;
|
||||
tap: boolean;
|
||||
bounce: boolean | BounceObjectOption;
|
||||
bounceTime: number;
|
||||
momentum: boolean;
|
||||
momentumLimitTime: number;
|
||||
momentumLimitDistance: number;
|
||||
swipeTime: number;
|
||||
swipeBounceTime: number;
|
||||
deceleration: number;
|
||||
flickLimitTime: number;
|
||||
flickLimitDistance: number;
|
||||
resizePolling: number;
|
||||
probeType: number;
|
||||
preventDefault: boolean;
|
||||
preventDefaultException: object;
|
||||
HWCompositing: boolean;
|
||||
useTransition: boolean;
|
||||
useTransform: boolean;
|
||||
bindToWrapper: boolean;
|
||||
disableMouse: boolean;
|
||||
disableTouch: boolean;
|
||||
observeDOM: boolean;
|
||||
autoBlur: boolean;
|
||||
stopPropagation: boolean;
|
||||
/**
|
||||
* for picker
|
||||
* wheel: {
|
||||
* selectedIndex: 0,
|
||||
* rotate: 25,
|
||||
* adjustTime: 400
|
||||
* }
|
||||
*/
|
||||
wheel: Partial<WheelOption> | boolean;
|
||||
/**
|
||||
* for slide
|
||||
* snap: {
|
||||
* loop: boolean,
|
||||
* el: domEl,
|
||||
* threshold: 0.1,
|
||||
* stepX: 100,
|
||||
* stepY: 100,
|
||||
* listenFlick: true
|
||||
* }
|
||||
*/
|
||||
snap: Partial<SlideOption> | boolean;
|
||||
/**
|
||||
* for scrollbar
|
||||
* scrollbar: {
|
||||
* fade: true
|
||||
* }
|
||||
*/
|
||||
scrollbar: Partial<ScrollBarOption> | boolean;
|
||||
/**
|
||||
* for pull down and refresh
|
||||
* pullDownRefresh: {
|
||||
* threshold: 50,
|
||||
* stop: 20
|
||||
* }
|
||||
*/
|
||||
pullDownRefresh: Partial<PullDownOption> | boolean;
|
||||
/**
|
||||
* for pull up and load
|
||||
* pullUpLoad: {
|
||||
* threshold: 50
|
||||
* }
|
||||
*/
|
||||
pullUpLoad: Partial<PullUpOption> | boolean;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export default class BScroll {
|
||||
constructor(element: Element | string, options?: Partial<BsOption>);
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
maxScrollX: number;
|
||||
maxScrollY: number;
|
||||
movingDirectionX: number;
|
||||
movingDirectionY: number;
|
||||
directionX: number;
|
||||
directionY: number;
|
||||
enabled: boolean;
|
||||
isInTransition: boolean;
|
||||
isAnimating: boolean;
|
||||
options: BsOption;
|
||||
|
||||
refresh(): void;
|
||||
|
||||
enable(): void;
|
||||
|
||||
disable(): void;
|
||||
|
||||
scrollBy(x: number, y: number, time?: number, easing?: object): void;
|
||||
|
||||
scrollTo(x: number, y: number, time?: number, easing?: object): void;
|
||||
|
||||
scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: object): void;
|
||||
|
||||
stop(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
goToPage(x: number, y: number, time?: number, easing?: object): void;
|
||||
|
||||
next(time?: number, easing?: object): void;
|
||||
|
||||
prev(time?: number, easing?: object): void;
|
||||
|
||||
getCurrentPage(): PageOption;
|
||||
|
||||
wheelTo(index: number): void;
|
||||
|
||||
getSelectedIndex(): number;
|
||||
|
||||
finishPullDown(): void;
|
||||
|
||||
finishPullUp(): void;
|
||||
|
||||
on(
|
||||
type:
|
||||
'beforeScrollStart' |
|
||||
'scrollStart' |
|
||||
'scrollCancel' |
|
||||
'beforeScrollStart' |
|
||||
'flick' |
|
||||
'refresh' |
|
||||
'destroy' |
|
||||
'pullingDown' |
|
||||
'pullingUp',
|
||||
fn: () => any
|
||||
): void;
|
||||
|
||||
on(
|
||||
type:
|
||||
'scroll' |
|
||||
'scrollEnd' |
|
||||
'touchEnd',
|
||||
fn: (pos: Position) => any
|
||||
): void;
|
||||
|
||||
off(
|
||||
type:
|
||||
'beforeScrollStart' |
|
||||
'scrollStart' |
|
||||
'scroll' |
|
||||
'scrollCancel' |
|
||||
'beforeScrollStart' |
|
||||
'scrollEnd' |
|
||||
'touchEnd' |
|
||||
'flick' |
|
||||
'refresh' |
|
||||
'destroy' |
|
||||
'pullingDown' |
|
||||
'pullingUp',
|
||||
fn: (...args: any[]) => void
|
||||
): void;
|
||||
|
||||
trigger(type: string): void;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"better-scroll-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -13,8 +13,10 @@ import * as d3Hierarchy from 'd3-hierarchy';
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
let num: number;
|
||||
let numOrUndefined: number | undefined;
|
||||
let size: [number, number];
|
||||
let idString: string;
|
||||
let sizeOrNull: [number, number] | null;
|
||||
let idString: string | undefined;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Hierarchy
|
||||
@@ -47,16 +49,20 @@ let hierarchyRootDatum: HierarchyDatum = {
|
||||
]
|
||||
};
|
||||
|
||||
let hierarchyNodeArray: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>>;
|
||||
let hierarchyNodeArray: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>> = [];
|
||||
let hierarchyNodeArrayOrUndefined: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>> | undefined;
|
||||
let hierarchyNode: d3Hierarchy.HierarchyNode<HierarchyDatum>;
|
||||
|
||||
let hierarchyPointNodeArray: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>>;
|
||||
let hierarchyPointNodeArray: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>> = [];
|
||||
let hierarchyPointNodeArrayOrUndefined: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>> | undefined;
|
||||
let hierarchyPointNode: d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>;
|
||||
|
||||
let hierarchyRectangularNodeArray: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>>;
|
||||
let hierarchyRectangularNodeArray: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>> = [];
|
||||
let hierarchyRectangularNodeArrayOrUndefined: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>> | undefined;
|
||||
let hierarchyRectangularNode: d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>;
|
||||
|
||||
let hierarchyCircularNodeArray: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>>;
|
||||
let hierarchyCircularNodeArray: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>> = [];
|
||||
let hierarchyCircularNodeArrayOrUndefined: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>> | undefined;
|
||||
let hierarchyCircularNode: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>;
|
||||
|
||||
// Create Hierarchy Layout Root Node =====================================
|
||||
@@ -65,6 +71,10 @@ let hierarchyRootNode: d3Hierarchy.HierarchyNode<HierarchyDatum>;
|
||||
|
||||
hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum);
|
||||
|
||||
hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => {
|
||||
return d.children;
|
||||
});
|
||||
|
||||
hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => {
|
||||
return d.children || null;
|
||||
});
|
||||
@@ -79,10 +89,11 @@ num = hierarchyRootNode.height;
|
||||
|
||||
// children, parent ------------------------------------------------------
|
||||
|
||||
hierarchyNodeArray = hierarchyRootNode.children;
|
||||
hierarchyNodeArrayOrUndefined = hierarchyRootNode.children;
|
||||
|
||||
let parentNode: d3Hierarchy.HierarchyNode<HierarchyDatum>;
|
||||
let parentNode: d3Hierarchy.HierarchyNode<HierarchyDatum> | null;
|
||||
parentNode = hierarchyNodeArray.length ? hierarchyNodeArray[0].parent : null;
|
||||
parentNode = hierarchyNodeArray[0].parent;
|
||||
|
||||
// id --------------------------------------------------------------------
|
||||
|
||||
@@ -93,17 +104,17 @@ idString = hierarchyRootNode.id;
|
||||
const ancestors: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>> = hierarchyRootNode.ancestors();
|
||||
const descendants: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>> = hierarchyRootNode.descendants();
|
||||
|
||||
// leaves() ---------------------------------------------------------------
|
||||
// leaves() --------------------------------------------------------------
|
||||
|
||||
hierarchyNodeArray = hierarchyRootNode.leaves();
|
||||
|
||||
// path() -------------------------------------------------------------------
|
||||
// path() ----------------------------------------------------------------
|
||||
|
||||
hierarchyNode = descendants[descendants.length - 1];
|
||||
|
||||
const path: Array<d3Hierarchy.HierarchyNode<HierarchyDatum>> = hierarchyRootNode.path(hierarchyNode);
|
||||
|
||||
// links() and HierarchyLink<...> ------------------------------------------
|
||||
// links() and HierarchyLink<...> ----------------------------------------
|
||||
|
||||
let links: Array<d3Hierarchy.HierarchyLink<HierarchyDatum>>;
|
||||
|
||||
@@ -115,26 +126,26 @@ link = links[0];
|
||||
hierarchyNode = link.source;
|
||||
hierarchyNode = link.target;
|
||||
|
||||
// sum() and value ----------------------------------------------------------
|
||||
// sum() and value -------------------------------------------------------
|
||||
|
||||
hierarchyRootNode = hierarchyRootNode.sum((d) => d.val);
|
||||
|
||||
num = hierarchyRootNode.value;
|
||||
numOrUndefined = hierarchyRootNode.value;
|
||||
|
||||
// count() and value ----------------------------------------------------------
|
||||
// count() and value -----------------------------------------------------
|
||||
|
||||
hierarchyRootNode = hierarchyRootNode.count();
|
||||
|
||||
num = hierarchyRootNode.value;
|
||||
numOrUndefined = hierarchyRootNode.value;
|
||||
|
||||
// sort ---------------------------------------------------------------------
|
||||
// sort ------------------------------------------------------------------
|
||||
|
||||
hierarchyRootNode = hierarchyRootNode.sort((a, b) => {
|
||||
console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode<HierarchyDatum>
|
||||
return b.height - a.height || b.value - a.value;
|
||||
return b.height - a.height || b.value! - a.value!;
|
||||
});
|
||||
|
||||
// each(), eachAfter(), eachBefore() ----------------------------------------
|
||||
// each(), eachAfter(), eachBefore() -------------------------------------
|
||||
|
||||
hierarchyRootNode = hierarchyRootNode.each((node) => {
|
||||
console.log('Raw value of node:', node.data.val); // node type is HierarchyNode<HierarchyDatum>
|
||||
@@ -151,7 +162,7 @@ hierarchyRootNode = hierarchyRootNode.eachBefore((node) => {
|
||||
console.log('Aggregated value of node:', node.value); // node type is HierarchyNode<HierarchyDatum>
|
||||
});
|
||||
|
||||
// copy() --------------------------------------------------------------------
|
||||
// copy() ----------------------------------------------------------------
|
||||
|
||||
let copiedHierarchyNode: d3Hierarchy.HierarchyNode<HierarchyDatum>;
|
||||
copiedHierarchyNode = hierarchyRootNode.copy();
|
||||
@@ -161,12 +172,12 @@ copiedHierarchyNode = hierarchyRootNode.copy();
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
interface HierarchyDatumWithParentId extends HierarchyDatum {
|
||||
parentId: string;
|
||||
parentId: string | null;
|
||||
}
|
||||
|
||||
interface TabularHierarchyDatum {
|
||||
name: string;
|
||||
parentId: string;
|
||||
parentId: string | null;
|
||||
val: number;
|
||||
}
|
||||
|
||||
@@ -178,7 +189,7 @@ tabularData = [
|
||||
{ name: 'n121', parentId: 'n12', val: 30 }
|
||||
];
|
||||
|
||||
let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: TabularHierarchyDatum[]) => (string | null | '' | undefined);
|
||||
let idStringAccessor: (d: TabularHierarchyDatum, i: number, data: TabularHierarchyDatum[]) => (string | null | '' | undefined);
|
||||
|
||||
// Create Stratify Operator ---------------------------------------------
|
||||
|
||||
@@ -217,7 +228,8 @@ idStringAccessor = stratificatorizer.parentId();
|
||||
|
||||
// Use Stratify Operator ------------------------------------------------
|
||||
|
||||
const stratifiedRootNode: d3Hierarchy.HierarchyNode<HierarchyDatumWithParentId> = stratificatorizer(tabularData);
|
||||
const stratifiedRootNode: d3Hierarchy.HierarchyNode<TabularHierarchyDatum> = stratificatorizer(tabularData);
|
||||
const pId: string | null = stratifiedRootNode.data.parentId;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Cluster
|
||||
@@ -235,12 +247,12 @@ clusterLayout = d3Hierarchy.cluster<HierarchyDatumWithParentId>();
|
||||
|
||||
clusterLayout = clusterLayout.size([200, 200]);
|
||||
|
||||
size = clusterLayout.size();
|
||||
sizeOrNull = clusterLayout.size();
|
||||
|
||||
// nodeSize() ------------------------------------------------------------
|
||||
|
||||
clusterLayout = clusterLayout.nodeSize([10, 10]);
|
||||
size = clusterLayout.nodeSize();
|
||||
sizeOrNull = clusterLayout.nodeSize();
|
||||
|
||||
// separation() ----------------------------------------------------------
|
||||
|
||||
@@ -272,10 +284,11 @@ num = clusterRootNode.height;
|
||||
|
||||
// children, parent ------------------------------------------------------
|
||||
|
||||
hierarchyPointNodeArray = clusterRootNode.children;
|
||||
hierarchyPointNodeArrayOrUndefined = clusterRootNode.children;
|
||||
|
||||
let parentPointNode: d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>;
|
||||
let parentPointNode: d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId> | null;
|
||||
parentPointNode = hierarchyPointNodeArray.length ? hierarchyPointNodeArray[0].parent : null;
|
||||
parentPointNode = hierarchyPointNodeArray[0].parent;
|
||||
|
||||
// id --------------------------------------------------------------------
|
||||
|
||||
@@ -286,17 +299,17 @@ idString = clusterRootNode.id;
|
||||
const pointNodeAncestors: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>> = clusterRootNode.ancestors();
|
||||
const pointNodeDescendants: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>> = clusterRootNode.descendants();
|
||||
|
||||
// leaves() ---------------------------------------------------------------
|
||||
// leaves() --------------------------------------------------------------
|
||||
|
||||
hierarchyPointNodeArray = clusterRootNode.leaves();
|
||||
|
||||
// path() -------------------------------------------------------------------
|
||||
// path() ----------------------------------------------------------------
|
||||
|
||||
hierarchyPointNode = pointNodeDescendants[pointNodeDescendants.length - 1];
|
||||
|
||||
const clusterPath: Array<d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>> = clusterRootNode.path(hierarchyPointNode);
|
||||
|
||||
// links() and HierarchyPointLink<...> ------------------------------------------
|
||||
// links() and HierarchyPointLink<...> -----------------------------------
|
||||
|
||||
let pointLinks: Array<d3Hierarchy.HierarchyPointLink<HierarchyDatumWithParentId>>;
|
||||
|
||||
@@ -308,27 +321,27 @@ pointLink = pointLinks[0];
|
||||
hierarchyPointNode = pointLink.source;
|
||||
hierarchyPointNode = pointLink.target;
|
||||
|
||||
// sum() and value ----------------------------------------------------------
|
||||
// sum() and value -------------------------------------------------------
|
||||
|
||||
clusterRootNode = clusterRootNode.sum((d) => d.val);
|
||||
|
||||
num = clusterRootNode.value;
|
||||
numOrUndefined = clusterRootNode.value;
|
||||
|
||||
// count() and value ----------------------------------------------------------
|
||||
// count() and value -----------------------------------------------------
|
||||
|
||||
clusterRootNode = clusterRootNode.count();
|
||||
|
||||
num = clusterRootNode.value;
|
||||
numOrUndefined = clusterRootNode.value;
|
||||
|
||||
// sort ---------------------------------------------------------------------
|
||||
// sort ------------------------------------------------------------------
|
||||
|
||||
clusterRootNode = clusterRootNode.sort((a, b) => {
|
||||
console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode<HierarchyDatumWithParentId>
|
||||
console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode<HierarchyDatumWithParentId>
|
||||
return b.height - a.height || b.value - a.value;
|
||||
return b.height - a.height || b.value! - a.value!;
|
||||
});
|
||||
|
||||
// each(), eachAfter(), eachBefore() ----------------------------------------
|
||||
// each(), eachAfter(), eachBefore() -------------------------------------
|
||||
|
||||
clusterRootNode = clusterRootNode.each((node) => {
|
||||
console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode<HierarchyDatumWithParentId>
|
||||
@@ -345,7 +358,7 @@ clusterRootNode = clusterRootNode.eachBefore((node) => {
|
||||
console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode<HierarchyDatumWithParentId>
|
||||
});
|
||||
|
||||
// copy() --------------------------------------------------------------------
|
||||
// copy() ----------------------------------------------------------------
|
||||
|
||||
let copiedClusterNode: d3Hierarchy.HierarchyPointNode<HierarchyDatumWithParentId>;
|
||||
copiedClusterNode = clusterRootNode.copy();
|
||||
@@ -354,24 +367,24 @@ copiedClusterNode = clusterRootNode.copy();
|
||||
// Tree
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// Create tree layout generator =======================================
|
||||
// Create tree layout generator ==========================================
|
||||
|
||||
let treeLayout: d3Hierarchy.TreeLayout<HierarchyDatumWithParentId>;
|
||||
|
||||
treeLayout = d3Hierarchy.tree<HierarchyDatumWithParentId>();
|
||||
|
||||
// Configure tree layout generator ====================================
|
||||
// Configure tree layout generator =======================================
|
||||
|
||||
// size() ----------------------------------------------------------------
|
||||
|
||||
treeLayout = treeLayout.size([200, 200]);
|
||||
|
||||
size = treeLayout.size();
|
||||
sizeOrNull = treeLayout.size();
|
||||
|
||||
// nodeSize() ------------------------------------------------------------
|
||||
|
||||
treeLayout = treeLayout.nodeSize([10, 10]);
|
||||
size = treeLayout.nodeSize();
|
||||
sizeOrNull = treeLayout.nodeSize();
|
||||
|
||||
// separation() ----------------------------------------------------------
|
||||
|
||||
@@ -424,13 +437,13 @@ treemapLayout = treemapLayout.size([400, 200]);
|
||||
|
||||
size = treemapLayout.size();
|
||||
|
||||
// round() ------------------------------------------------------------
|
||||
// round() ---------------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.round(true);
|
||||
|
||||
let roundFlag: boolean = treemapLayout.round();
|
||||
|
||||
// padding() ----------------------------------------------------------------
|
||||
// padding() -------------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.padding(1);
|
||||
treemapLayout = treemapLayout.padding((node) => {
|
||||
@@ -440,7 +453,7 @@ treemapLayout = treemapLayout.padding((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.padding();
|
||||
|
||||
// paddingInner() ----------------------------------------------------------------
|
||||
// paddingInner() --------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingInner(1);
|
||||
treemapLayout = treemapLayout.paddingInner((node) => {
|
||||
@@ -450,7 +463,7 @@ treemapLayout = treemapLayout.paddingInner((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.paddingInner();
|
||||
|
||||
// paddingOuter() ----------------------------------------------------------------
|
||||
// paddingOuter() --------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingOuter(1);
|
||||
treemapLayout = treemapLayout.paddingOuter((node) => {
|
||||
@@ -460,7 +473,7 @@ treemapLayout = treemapLayout.paddingOuter((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.paddingOuter();
|
||||
|
||||
// paddingTop() ----------------------------------------------------------------
|
||||
// paddingTop() ----------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingTop(1);
|
||||
treemapLayout = treemapLayout.paddingTop((node) => {
|
||||
@@ -470,7 +483,7 @@ treemapLayout = treemapLayout.paddingTop((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.paddingTop();
|
||||
|
||||
// paddingRight() ----------------------------------------------------------------
|
||||
// paddingRight() --------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingRight(1);
|
||||
treemapLayout = treemapLayout.paddingRight((node) => {
|
||||
@@ -480,7 +493,7 @@ treemapLayout = treemapLayout.paddingRight((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.paddingRight();
|
||||
|
||||
// paddingBottom() ----------------------------------------------------------------
|
||||
// paddingBottom() -------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingBottom(1);
|
||||
treemapLayout = treemapLayout.paddingBottom((node) => {
|
||||
@@ -490,7 +503,7 @@ treemapLayout = treemapLayout.paddingBottom((node) => {
|
||||
|
||||
numberRectangularNodeAccessor = treemapLayout.paddingBottom();
|
||||
|
||||
// paddingLeft() ----------------------------------------------------------------
|
||||
// paddingLeft() ---------------------------------------------------------
|
||||
|
||||
treemapLayout = treemapLayout.paddingLeft(1);
|
||||
treemapLayout = treemapLayout.paddingLeft((node) => {
|
||||
@@ -530,7 +543,7 @@ tilingFactoryFn = d3Hierarchy.treemapResquarify.ratio(2);
|
||||
|
||||
treemapLayout.tile(d3Hierarchy.treemapResquarify.ratio(2));
|
||||
|
||||
// Use HierarchyRectangularNode ================================================
|
||||
// Use HierarchyRectangularNode ==========================================
|
||||
|
||||
// x and y coordinates ---------------------------------------------------
|
||||
|
||||
@@ -547,10 +560,11 @@ num = treemapRootNode.height;
|
||||
|
||||
// children, parent ------------------------------------------------------
|
||||
|
||||
hierarchyRectangularNodeArray = treemapRootNode.children;
|
||||
hierarchyRectangularNodeArrayOrUndefined = treemapRootNode.children;
|
||||
|
||||
let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>;
|
||||
let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId> | null;
|
||||
parentRectangularNode = hierarchyRectangularNodeArray.length ? hierarchyRectangularNodeArray[0].parent : null;
|
||||
parentRectangularNode = hierarchyRectangularNodeArray[0].parent;
|
||||
|
||||
// id --------------------------------------------------------------------
|
||||
|
||||
@@ -561,17 +575,17 @@ idString = treemapRootNode.id;
|
||||
const rectangularNodeAncestors: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>> = treemapRootNode.ancestors();
|
||||
const rectangularNodeDescendants: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>> = treemapRootNode.descendants();
|
||||
|
||||
// leaves() ---------------------------------------------------------------
|
||||
// leaves() --------------------------------------------------------------
|
||||
|
||||
hierarchyRectangularNodeArray = treemapRootNode.leaves();
|
||||
|
||||
// path() -------------------------------------------------------------------
|
||||
// path() ----------------------------------------------------------------
|
||||
|
||||
hierarchyRectangularNode = rectangularNodeDescendants[rectangularNodeDescendants.length - 1];
|
||||
|
||||
const treemapPath: Array<d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>> = treemapRootNode.path(hierarchyRectangularNode);
|
||||
|
||||
// links() and HierarchyRectangularLink<...> ------------------------------------------
|
||||
// links() and HierarchyRectangularLink<...> -----------------------------
|
||||
|
||||
let rectangularLinks: Array<d3Hierarchy.HierarchyRectangularLink<HierarchyDatumWithParentId>>;
|
||||
|
||||
@@ -583,26 +597,26 @@ rectangularLink = rectangularLinks[0];
|
||||
hierarchyRectangularNode = rectangularLink.source;
|
||||
hierarchyRectangularNode = rectangularLink.target;
|
||||
|
||||
// sum() and value ----------------------------------------------------------
|
||||
// sum() and value -------------------------------------------------------
|
||||
|
||||
treemapRootNode = treemapRootNode.sum((d) => d.val);
|
||||
|
||||
num = treemapRootNode.value;
|
||||
numOrUndefined = treemapRootNode.value;
|
||||
|
||||
// count() and value ----------------------------------------------------------
|
||||
// count() and value -----------------------------------------------------
|
||||
|
||||
treemapRootNode = treemapRootNode.count();
|
||||
|
||||
num = treemapRootNode.value;
|
||||
// sort ---------------------------------------------------------------------
|
||||
numOrUndefined = treemapRootNode.value;
|
||||
// sort ------------------------------------------------------------------
|
||||
|
||||
treemapRootNode = treemapRootNode.sort((a, b) => {
|
||||
console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode<HierarchyDatumWithParentId>
|
||||
console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode<HierarchyDatumWithParentId>
|
||||
return b.height - a.height || b.value - a.value;
|
||||
return b.height - a.height || b.value! - a.value!;
|
||||
});
|
||||
|
||||
// each(), eachAfter(), eachBefore() ----------------------------------------
|
||||
// each(), eachAfter(), eachBefore() -------------------------------------
|
||||
|
||||
treemapRootNode = treemapRootNode.each((node) => {
|
||||
console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode<HierarchyDatumWithParentId>
|
||||
@@ -619,7 +633,7 @@ treemapRootNode = treemapRootNode.eachBefore((node) => {
|
||||
console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode<HierarchyDatumWithParentId>
|
||||
});
|
||||
|
||||
// copy() --------------------------------------------------------------------
|
||||
// copy() ----------------------------------------------------------------
|
||||
|
||||
let copiedTreemapNode: d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>;
|
||||
copiedTreemapNode = treemapRootNode.copy();
|
||||
@@ -628,13 +642,13 @@ copiedTreemapNode = treemapRootNode.copy();
|
||||
// Partition
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// Create partition layout generator =======================================
|
||||
// Create partition layout generator =====================================
|
||||
|
||||
let partitionLayout: d3Hierarchy.PartitionLayout<HierarchyDatumWithParentId>;
|
||||
|
||||
partitionLayout = d3Hierarchy.partition<HierarchyDatumWithParentId>();
|
||||
|
||||
// Configure partition layout generator ====================================
|
||||
// Configure partition layout generator ==================================
|
||||
|
||||
// size() ----------------------------------------------------------------
|
||||
|
||||
@@ -642,19 +656,19 @@ partitionLayout = partitionLayout.size([400, 200]);
|
||||
|
||||
size = partitionLayout.size();
|
||||
|
||||
// round() ------------------------------------------------------------
|
||||
// round() ---------------------------------------------------------------
|
||||
|
||||
partitionLayout = partitionLayout.round(true);
|
||||
|
||||
roundFlag = partitionLayout.round();
|
||||
|
||||
// padding() ----------------------------------------------------------------
|
||||
// padding() -------------------------------------------------------------
|
||||
|
||||
partitionLayout = partitionLayout.padding(1);
|
||||
|
||||
num = partitionLayout.padding();
|
||||
|
||||
// Use partition layout generator ==========================================
|
||||
// Use partition layout generator ========================================
|
||||
|
||||
let partitionRootNode: d3Hierarchy.HierarchyRectangularNode<HierarchyDatumWithParentId>;
|
||||
|
||||
@@ -664,15 +678,17 @@ partitionRootNode = partitionLayout(stratifiedRootNode);
|
||||
// Pack
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
let numberCircularNodeAccessor: (node: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>) => number;
|
||||
type CircularAccessor = (node: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>) => number;
|
||||
let numberCircularNodeAccessor: CircularAccessor;
|
||||
let numberCircularNodeAccessorOrNull: CircularAccessor | null;
|
||||
|
||||
// Create pack layout generator =======================================
|
||||
// Create pack layout generator ==========================================
|
||||
|
||||
let packLayout: d3Hierarchy.PackLayout<HierarchyDatumWithParentId>;
|
||||
|
||||
packLayout = d3Hierarchy.pack<HierarchyDatumWithParentId>();
|
||||
|
||||
// Configure pack layout generator ====================================
|
||||
// Configure pack layout generator =======================================
|
||||
|
||||
// size() ----------------------------------------------------------------
|
||||
|
||||
@@ -680,37 +696,39 @@ packLayout = packLayout.size([400, 400]);
|
||||
|
||||
size = packLayout.size();
|
||||
|
||||
// radius() ------------------------------------------------------------
|
||||
// radius() --------------------------------------------------------------
|
||||
|
||||
packLayout = packLayout.radius(null);
|
||||
|
||||
packLayout = packLayout.radius((node) => {
|
||||
console.log('Radius property of node before completing accessor: ', node.r); // node is of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
return node.value;
|
||||
return node.value!;
|
||||
});
|
||||
|
||||
numberCircularNodeAccessor = packLayout.radius();
|
||||
numberCircularNodeAccessorOrNull = packLayout.radius();
|
||||
|
||||
// padding() ----------------------------------------------------------------
|
||||
// padding() -------------------------------------------------------------
|
||||
|
||||
packLayout = packLayout.padding(1);
|
||||
|
||||
packLayout = packLayout.padding((node) => {
|
||||
console.log('Radius property of node: ', node.r); // node is of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
return node.value > 10 ? 2 : 1;
|
||||
return node.value! > 10 ? 2 : 1;
|
||||
});
|
||||
|
||||
numberCircularNodeAccessor = packLayout.padding();
|
||||
|
||||
// Use partition layout generator ==========================================
|
||||
// Use partition layout generator ========================================
|
||||
|
||||
let packRootNode: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>;
|
||||
|
||||
packRootNode = packLayout(stratifiedRootNode);
|
||||
|
||||
// Use HierarchyCircularNode ================================================
|
||||
// Use HierarchyCircularNode =============================================
|
||||
|
||||
// x and y coordinates and radius r ------------------------------------------
|
||||
// x and y coordinates and radius r --------------------------------------
|
||||
|
||||
num = packRootNode.x;
|
||||
num = packRootNode.y;
|
||||
@@ -724,10 +742,11 @@ num = packRootNode.height;
|
||||
|
||||
// children, parent ------------------------------------------------------
|
||||
|
||||
hierarchyCircularNodeArray = packRootNode.children;
|
||||
hierarchyCircularNodeArrayOrUndefined = packRootNode.children;
|
||||
|
||||
let parentCircularNode: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>;
|
||||
let parentCircularNode: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId> | null;
|
||||
parentCircularNode = hierarchyCircularNodeArray.length ? hierarchyCircularNodeArray[0].parent : null;
|
||||
parentCircularNode = hierarchyCircularNodeArray[0].parent;
|
||||
|
||||
// id --------------------------------------------------------------------
|
||||
|
||||
@@ -738,17 +757,17 @@ idString = packRootNode.id;
|
||||
const circularNodeAncestors: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>> = packRootNode.ancestors();
|
||||
const circularNodeDescendants: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>> = packRootNode.descendants();
|
||||
|
||||
// leaves() ---------------------------------------------------------------
|
||||
// leaves() --------------------------------------------------------------
|
||||
|
||||
hierarchyCircularNodeArray = packRootNode.leaves();
|
||||
|
||||
// path() -------------------------------------------------------------------
|
||||
// path() ----------------------------------------------------------------
|
||||
|
||||
hierarchyCircularNode = circularNodeDescendants[circularNodeDescendants.length - 1];
|
||||
|
||||
const packPath: Array<d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>> = packRootNode.path(hierarchyCircularNode);
|
||||
|
||||
// links() and HierarchyRectangularLink<...> ------------------------------------------
|
||||
// links() and HierarchyRectangularLink<...> -----------------------------
|
||||
|
||||
let circularLinks: Array<d3Hierarchy.HierarchyCircularLink<HierarchyDatumWithParentId>>;
|
||||
|
||||
@@ -760,26 +779,27 @@ circularLink = circularLinks[0];
|
||||
hierarchyCircularNode = circularLink.source;
|
||||
hierarchyCircularNode = circularLink.target;
|
||||
|
||||
// sum() and value ----------------------------------------------------------
|
||||
// sum() and value -------------------------------------------------------
|
||||
|
||||
packRootNode = packRootNode.sum((d) => d.val);
|
||||
|
||||
num = packRootNode.value;
|
||||
numOrUndefined = packRootNode.value;
|
||||
|
||||
// count() and value ----------------------------------------------------------
|
||||
// count() and value -----------------------------------------------------
|
||||
|
||||
packRootNode = packRootNode.count();
|
||||
|
||||
num = packRootNode.value;
|
||||
// sort ---------------------------------------------------------------------
|
||||
numOrUndefined = packRootNode.value;
|
||||
|
||||
// sort ------------------------------------------------------------------
|
||||
|
||||
packRootNode = packRootNode.sort((a, b) => {
|
||||
console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
return b.height - a.height || b.value - a.value;
|
||||
return b.height - a.height || b.value! - a.value!;
|
||||
});
|
||||
|
||||
// each(), eachAfter(), eachBefore() ----------------------------------------
|
||||
// each(), eachAfter(), eachBefore() -------------------------------------
|
||||
|
||||
packRootNode = packRootNode.each((node) => {
|
||||
console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
@@ -796,7 +816,7 @@ packRootNode = packRootNode.eachBefore((node) => {
|
||||
console.log('Radius of node:', node.r); // node type is HierarchyCircularNode<HierarchyDatumWithParentId>
|
||||
});
|
||||
|
||||
// copy() --------------------------------------------------------------------
|
||||
// copy() ----------------------------------------------------------------
|
||||
|
||||
let copiedPackNode: d3Hierarchy.HierarchyCircularNode<HierarchyDatumWithParentId>;
|
||||
copiedPackNode = packRootNode.copy();
|
||||
|
||||
Vendored
+5
-5
@@ -154,7 +154,7 @@ export interface HierarchyNode<Datum> {
|
||||
* Must return an array of data representing the children, and return null or undefined if the current datum has no children.
|
||||
* If children is not specified, it defaults to: `(d) => d.children`.
|
||||
*/
|
||||
export function hierarchy<Datum>(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode<Datum>;
|
||||
export function hierarchy<Datum>(data: Datum, children?: (d: Datum) => (Datum[] | null | undefined)): HierarchyNode<Datum>;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Stratify
|
||||
@@ -182,7 +182,7 @@ export interface StratifyOperator<Datum> {
|
||||
*
|
||||
* @param id The id accessor.
|
||||
*/
|
||||
id(id: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this;
|
||||
id(id: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this;
|
||||
|
||||
/**
|
||||
* Returns the current parent id accessor, which defaults to: `(d) => d.parentId`.
|
||||
@@ -197,7 +197,7 @@ export interface StratifyOperator<Datum> {
|
||||
*
|
||||
* @param parentId The parent id accessor.
|
||||
*/
|
||||
parentId(parentId: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this;
|
||||
parentId(parentId: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -576,7 +576,7 @@ export interface TreemapLayout<Datum> {
|
||||
*/
|
||||
export function treemap<Datum>(): TreemapLayout<Datum>;
|
||||
|
||||
// Tiling functions -----------------------------------------------------------------------
|
||||
// Tiling functions ------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Recursively partitions the specified nodes into an approximately-balanced binary tree,
|
||||
@@ -748,7 +748,7 @@ export interface PackLayout<Datum> {
|
||||
*
|
||||
* @param radius The specified radius accessor.
|
||||
*/
|
||||
radius(radius: (node: HierarchyCircularNode<Datum>) => number): this;
|
||||
radius(radius: null | ((node: HierarchyCircularNode<Datum>) => number)): this;
|
||||
|
||||
/**
|
||||
* Returns the current size, which defaults to [1, 1].
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
@@ -1184,7 +1184,7 @@ interface SymbolDatum {
|
||||
let customSymbol: d3Shape.SymbolType;
|
||||
|
||||
customSymbol = {
|
||||
draw(context: CanvasPathMethods, size: number): void {
|
||||
draw(context: d3Shape.CanvasPath_D3Shape, size: number): void {
|
||||
// draw custom symbol using canvas path methods
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+24
-3
@@ -7,6 +7,27 @@
|
||||
|
||||
import { Path } from 'd3-path';
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// Shared Types and Interfaces
|
||||
// -----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* This interface is used to bridge the gap between two incompatible versions of TypeScript (see [#25944](https://github.com/Microsoft/TypeScript/pull/25944)).
|
||||
* Use `CanvasPathMethods` instead with TS <= 3.0 and `CanvasPath` with TS >= 3.1.
|
||||
*/
|
||||
export interface CanvasPath_D3Shape {
|
||||
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
|
||||
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
||||
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
|
||||
closePath(): void;
|
||||
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
|
||||
lineTo(x: number, y: number): void;
|
||||
moveTo(x: number, y: number): void;
|
||||
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
|
||||
rect(x: number, y: number, w: number, h: number): void;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// Arc Generator
|
||||
// -----------------------------------------------------------------------------------
|
||||
@@ -2264,13 +2285,13 @@ export function linkRadial<This, LinkDatum, NodeDatum>(): LinkRadial<This, LinkD
|
||||
*/
|
||||
export interface SymbolType {
|
||||
/**
|
||||
* Renders this symbol type to the specified context with the specified size in square pixels. The context implements the CanvasPathMethods interface.
|
||||
* Renders this symbol type to the specified context with the specified size in square pixels. The context implements the CanvasPath interface.
|
||||
* (Note that this is a subset of the CanvasRenderingContext2D interface!)
|
||||
*
|
||||
* @param context A rendering context implementing CanvasPathMethods.
|
||||
* @param context A rendering context implementing CanvasPath.
|
||||
* @param size Size of the symbol to draw.
|
||||
*/
|
||||
draw(context: CanvasPathMethods, size: number): void;
|
||||
draw(context: CanvasPath_D3Shape, size: number): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+250
-250
@@ -1,250 +1,250 @@
|
||||
import * as dav from "dav";
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
);
|
||||
|
||||
dav.createAccount({ server: 'http://dav.example.com', xhr })
|
||||
.then((account) => {
|
||||
account.calendars.forEach(() => {
|
||||
});
|
||||
});
|
||||
const client = new dav.Client(xhr);
|
||||
|
||||
client.createAccount({
|
||||
server: 'http://dav.example.com',
|
||||
accountType: 'carddav'
|
||||
}).then((account) => {
|
||||
account.addressBooks.forEach(() => {
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const client = new dav.Client(
|
||||
new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
),
|
||||
{
|
||||
baseUrl: 'https://mail.mozilla.com'
|
||||
}
|
||||
);
|
||||
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: '12345'
|
||||
});
|
||||
|
||||
client.send(req, '/calendars/123.ics')
|
||||
.then(() => { });
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
);
|
||||
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: '12345'
|
||||
});
|
||||
|
||||
xhr.send(req, 'https://mail.mozilla.com/calendars/123.ics')
|
||||
.then(() => {
|
||||
});
|
||||
})();
|
||||
|
||||
dav.debug.enabled = true;
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'Killer BOB',
|
||||
password: 'blacklodge'
|
||||
})
|
||||
);
|
||||
|
||||
const client = new dav.Client(xhr, { baseUrl: 'https://mail.mozilla.com' });
|
||||
|
||||
const url = 'https://mail.mozilla.com/';
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: 'abc123'
|
||||
});
|
||||
|
||||
const sandbox = dav.createSandbox();
|
||||
client.send(req, url, { sandbox });
|
||||
xhr.send(req, url, { sandbox });
|
||||
|
||||
client.createAccount({ sandbox: {}, server: 'http://dav.example.com' });
|
||||
dav.createAccount({
|
||||
sandbox: {},
|
||||
server: 'http://dav.example.com',
|
||||
xhr
|
||||
});
|
||||
|
||||
let calendar = new dav.Calendar();
|
||||
client.createCalendarObject(calendar, {
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
filename: 'test.ics'
|
||||
});
|
||||
dav.createCalendarObject(
|
||||
calendar,
|
||||
{
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
filename: 'test.ics',
|
||||
xhr
|
||||
});
|
||||
|
||||
let object = new dav.CalendarObject();
|
||||
client.updateCalendarObject(object);
|
||||
dav.updateCalendarObject(
|
||||
object,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
object = new dav.CalendarObject();
|
||||
client.deleteCalendarObject(object);
|
||||
dav.deleteCalendarObject(
|
||||
object,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
calendar = new dav.Calendar();
|
||||
client.syncCalendar(calendar, { syncMethod: 'webdav' });
|
||||
dav.syncCalendar(
|
||||
calendar,
|
||||
{
|
||||
syncMethod: 'webdav',
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
let account = new dav.Account();
|
||||
client.syncCaldavAccount(account, { syncMethod: 'webdav' });
|
||||
dav.syncCaldavAccount(
|
||||
account,
|
||||
{
|
||||
syncMethod: 'webdav',
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
let addressBook = new dav.AddressBook();
|
||||
client.createCard(addressBook, {
|
||||
data: 'BEGIN:VCARD\nEND:VCARD',
|
||||
filename: 'test.vcf'
|
||||
});
|
||||
dav.createCard(addressBook,
|
||||
{
|
||||
data: 'BEGIN:VCARD\nEND:VCARD',
|
||||
filename: 'test.vcf',
|
||||
xhr
|
||||
});
|
||||
|
||||
let vcard = new dav.VCard();
|
||||
client.updateCard(vcard);
|
||||
dav.updateCard(
|
||||
vcard,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
vcard = new dav.VCard();
|
||||
client.deleteCard(vcard);
|
||||
dav.deleteCard(
|
||||
vcard,
|
||||
{
|
||||
xhr
|
||||
});
|
||||
|
||||
addressBook = new dav.AddressBook();
|
||||
client.syncAddressBook(addressBook, {
|
||||
syncMethod: 'basic'
|
||||
});
|
||||
|
||||
dav.syncAddressBook(
|
||||
addressBook,
|
||||
{
|
||||
syncMethod: 'basic',
|
||||
xhr
|
||||
});
|
||||
|
||||
account = new dav.Account();
|
||||
client.syncCarddavAccount(account, { syncMethod: 'basic' });
|
||||
|
||||
dav.syncCarddavAccount(
|
||||
account,
|
||||
{
|
||||
syncMethod: 'basic',
|
||||
xhr
|
||||
});
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({ username: 'admin', password: 'admin' })
|
||||
);
|
||||
|
||||
const req: dav.Request = {
|
||||
method: 'GET',
|
||||
transformRequest: (xhr: any) => xhr
|
||||
};
|
||||
|
||||
const sandbox = dav.createSandbox();
|
||||
xhr.send(req, 'http://127.0.0.1:1337', { sandbox });
|
||||
sandbox.requestList;
|
||||
|
||||
xhr.send(req, 'http://127.0.0.1:1337');
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const credentials = new dav.Credentials({
|
||||
clientId: '605300196874-1ki833poa7uqabmh3hq' +
|
||||
'6u1onlqlsi54h.apps.googleusercontent.com',
|
||||
clientSecret: 'jQTKlOhF-RclGaGJot3HIcVf',
|
||||
redirectUrl: 'https://oauth.gaiamobile.org/authenticated',
|
||||
tokenUrl: 'https://accounts.google.com/o/oauth2/token',
|
||||
authorizationCode: 'gareth'
|
||||
});
|
||||
|
||||
const xhr = new dav.transport.OAuth2(credentials);
|
||||
|
||||
const req = { method: 'GET' };
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = '1/oPHTPFgECWFPrs7KgHdis24u6Xl4E4EnRrkkiwLfzdk';
|
||||
credentials.expiration = Date.now() - 1;
|
||||
|
||||
xhr.send(req, 'http://127.0.0.1:1337', {
|
||||
retry: false
|
||||
});
|
||||
|
||||
credentials.accessToken = 'Little Bear';
|
||||
credentials.refreshToken = 'spicy tamales';
|
||||
const expiration = credentials.expiration = Date.now() + 60 * 60 * 1000;
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = 'raspberry pie';
|
||||
credentials.expiration = Date.now() + 60 * 60 * 1000;
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = 'soda';
|
||||
})();
|
||||
import * as dav from "dav";
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
);
|
||||
|
||||
dav.createAccount({ server: 'http://dav.example.com', xhr })
|
||||
.then((account) => {
|
||||
account.calendars.forEach(() => {
|
||||
});
|
||||
});
|
||||
const client = new dav.Client(xhr);
|
||||
|
||||
client.createAccount({
|
||||
server: 'http://dav.example.com',
|
||||
accountType: 'carddav'
|
||||
}).then((account) => {
|
||||
account.addressBooks.forEach(() => {
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const client = new dav.Client(
|
||||
new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
),
|
||||
{
|
||||
baseUrl: 'https://mail.mozilla.com'
|
||||
}
|
||||
);
|
||||
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: '12345'
|
||||
});
|
||||
|
||||
client.send(req, '/calendars/123.ics')
|
||||
.then(() => { });
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'xxx',
|
||||
password: 'xxx'
|
||||
})
|
||||
);
|
||||
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: '12345'
|
||||
});
|
||||
|
||||
xhr.send(req, 'https://mail.mozilla.com/calendars/123.ics')
|
||||
.then(() => {
|
||||
});
|
||||
})();
|
||||
|
||||
dav.debug.enabled = true;
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({
|
||||
username: 'Killer BOB',
|
||||
password: 'blacklodge'
|
||||
})
|
||||
);
|
||||
|
||||
const client = new dav.Client(xhr, { baseUrl: 'https://mail.mozilla.com' });
|
||||
|
||||
const url = 'https://mail.mozilla.com/';
|
||||
const req = dav.request.basic({
|
||||
method: 'PUT',
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
etag: 'abc123'
|
||||
});
|
||||
|
||||
const sandbox = dav.createSandbox();
|
||||
client.send(req, url, { sandbox });
|
||||
xhr.send(req, url, { sandbox });
|
||||
|
||||
client.createAccount({ sandbox: {}, server: 'http://dav.example.com' });
|
||||
dav.createAccount({
|
||||
sandbox: {},
|
||||
server: 'http://dav.example.com',
|
||||
xhr
|
||||
});
|
||||
|
||||
let calendar = new dav.Calendar();
|
||||
client.createCalendarObject(calendar, {
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
filename: 'test.ics'
|
||||
});
|
||||
dav.createCalendarObject(
|
||||
calendar,
|
||||
{
|
||||
data: 'BEGIN:VCALENDAR\nEND:VCALENDAR',
|
||||
filename: 'test.ics',
|
||||
xhr
|
||||
});
|
||||
|
||||
let object = new dav.CalendarObject();
|
||||
client.updateCalendarObject(object);
|
||||
dav.updateCalendarObject(
|
||||
object,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
object = new dav.CalendarObject();
|
||||
client.deleteCalendarObject(object);
|
||||
dav.deleteCalendarObject(
|
||||
object,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
calendar = new dav.Calendar();
|
||||
client.syncCalendar(calendar, { syncMethod: 'webdav' });
|
||||
dav.syncCalendar(
|
||||
calendar,
|
||||
{
|
||||
syncMethod: 'webdav',
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
let account = new dav.Account();
|
||||
client.syncCaldavAccount(account, { syncMethod: 'webdav' });
|
||||
dav.syncCaldavAccount(
|
||||
account,
|
||||
{
|
||||
syncMethod: 'webdav',
|
||||
xhr
|
||||
}
|
||||
);
|
||||
|
||||
let addressBook = new dav.AddressBook();
|
||||
client.createCard(addressBook, {
|
||||
data: 'BEGIN:VCARD\nEND:VCARD',
|
||||
filename: 'test.vcf'
|
||||
});
|
||||
dav.createCard(addressBook,
|
||||
{
|
||||
data: 'BEGIN:VCARD\nEND:VCARD',
|
||||
filename: 'test.vcf',
|
||||
xhr
|
||||
});
|
||||
|
||||
let vcard = new dav.VCard();
|
||||
client.updateCard(vcard);
|
||||
dav.updateCard(
|
||||
vcard,
|
||||
{
|
||||
xhr
|
||||
}
|
||||
);
|
||||
vcard = new dav.VCard();
|
||||
client.deleteCard(vcard);
|
||||
dav.deleteCard(
|
||||
vcard,
|
||||
{
|
||||
xhr
|
||||
});
|
||||
|
||||
addressBook = new dav.AddressBook();
|
||||
client.syncAddressBook(addressBook, {
|
||||
syncMethod: 'basic'
|
||||
});
|
||||
|
||||
dav.syncAddressBook(
|
||||
addressBook,
|
||||
{
|
||||
syncMethod: 'basic',
|
||||
xhr
|
||||
});
|
||||
|
||||
account = new dav.Account();
|
||||
client.syncCarddavAccount(account, { syncMethod: 'basic' });
|
||||
|
||||
dav.syncCarddavAccount(
|
||||
account,
|
||||
{
|
||||
syncMethod: 'basic',
|
||||
xhr
|
||||
});
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const xhr = new dav.transport.Basic(
|
||||
new dav.Credentials({ username: 'admin', password: 'admin' })
|
||||
);
|
||||
|
||||
const req: dav.Request = {
|
||||
method: 'GET',
|
||||
transformRequest: (xhr: any) => xhr
|
||||
};
|
||||
|
||||
const sandbox = dav.createSandbox();
|
||||
xhr.send(req, 'http://127.0.0.1:1337', { sandbox });
|
||||
sandbox.requestList;
|
||||
|
||||
xhr.send(req, 'http://127.0.0.1:1337');
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const credentials = new dav.Credentials({
|
||||
clientId: '605300196874-1ki833poa7uqabmh3hq' +
|
||||
'6u1onlqlsi54h.apps.googleusercontent.com',
|
||||
clientSecret: 'jQTKlOhF-RclGaGJot3HIcVf',
|
||||
redirectUrl: 'https://oauth.gaiamobile.org/authenticated',
|
||||
tokenUrl: 'https://accounts.google.com/o/oauth2/token',
|
||||
authorizationCode: 'gareth'
|
||||
});
|
||||
|
||||
const xhr = new dav.transport.OAuth2(credentials);
|
||||
|
||||
const req = { method: 'GET' };
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = '1/oPHTPFgECWFPrs7KgHdis24u6Xl4E4EnRrkkiwLfzdk';
|
||||
credentials.expiration = Date.now() - 1;
|
||||
|
||||
xhr.send(req, 'http://127.0.0.1:1337', {
|
||||
retry: false
|
||||
});
|
||||
|
||||
credentials.accessToken = 'Little Bear';
|
||||
credentials.refreshToken = 'spicy tamales';
|
||||
const expiration = credentials.expiration = Date.now() + 60 * 60 * 1000;
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = 'raspberry pie';
|
||||
credentials.expiration = Date.now() + 60 * 60 * 1000;
|
||||
|
||||
credentials.accessToken = 'EXPIRED';
|
||||
credentials.refreshToken = 'soda';
|
||||
})();
|
||||
|
||||
Vendored
+804
-804
File diff suppressed because it is too large
Load Diff
+22
-22
@@ -1,23 +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",
|
||||
"dav-tests.ts"
|
||||
]
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dav-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as ddTrace from 'dd-trace';
|
||||
import SpanContext = require('dd-trace/src/opentracing/span_context');
|
||||
import * as tracer from 'dd-trace';
|
||||
import { SpanContext } from 'opentracing';
|
||||
|
||||
const tracer = ddTrace.init({
|
||||
tracer.init({
|
||||
service: 'MyLovelyService',
|
||||
hostname: 'localhost',
|
||||
port: 8126,
|
||||
@@ -14,7 +14,7 @@ const tracer = ddTrace.init({
|
||||
tracer
|
||||
.trace('web.request', {
|
||||
service: 'my_service',
|
||||
childOf: new SpanContext({ traceId: 1337, spanId: 42 }),
|
||||
childOf: new SpanContext(),
|
||||
tags: {
|
||||
env: 'dev'
|
||||
}
|
||||
@@ -23,3 +23,13 @@ tracer
|
||||
span.setTag('my_tag', 'my_value');
|
||||
span.finish();
|
||||
});
|
||||
|
||||
const parentScope = tracer.scopeManager().active();
|
||||
const span = tracer.startSpan('memcached', {
|
||||
childOf: parentScope && parentScope.span(),
|
||||
tags: {
|
||||
'service.name': 'my-memcached',
|
||||
'resource.name': 'get',
|
||||
'span.type': 'memcached',
|
||||
},
|
||||
});
|
||||
|
||||
Vendored
+39
-4
@@ -1,11 +1,10 @@
|
||||
// Type definitions for dd-trace-js 0.2
|
||||
// Type definitions for dd-trace-js 0.5
|
||||
// Project: https://github.com/DataDog/dd-trace-js
|
||||
// Definitions by: Colin Bradley <https://github.com/ColinBradley>
|
||||
// Eloy Durán <https://github.com/alloy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import Tracer = require('./src/opentracing/tracer');
|
||||
import Span = require('./src/opentracing/span');
|
||||
import SpanContext = require('./src/opentracing/span_context');
|
||||
import { Tracer, Span, SpanContext } from "opentracing";
|
||||
|
||||
declare var trace: TraceProxy;
|
||||
export = trace;
|
||||
@@ -42,6 +41,11 @@ declare class TraceProxy extends Tracer {
|
||||
* @returns The current span or null if outside a trace context.
|
||||
*/
|
||||
currentSpan(): Span | null;
|
||||
|
||||
/**
|
||||
* Get the scope manager to manager context propagation for the tracer.
|
||||
*/
|
||||
scopeManager(): ScopeManager;
|
||||
}
|
||||
|
||||
interface TracerOptions {
|
||||
@@ -147,3 +151,34 @@ interface TraceOptions {
|
||||
*/
|
||||
tags?: { [key: string]: any } | string;
|
||||
}
|
||||
|
||||
declare class ScopeManager {
|
||||
/**
|
||||
* Get the current active scope or null if there is none.
|
||||
*
|
||||
* @todo The dd-trace source returns null, but opentracing's childOf span
|
||||
* option is typed as taking undefined or a scope, so using undefined
|
||||
* here instead.
|
||||
*/
|
||||
active(): Scope | undefined;
|
||||
|
||||
/**
|
||||
* Activate a new scope wrapping the provided span.
|
||||
*
|
||||
* @param span The span for which to activate the new scope.
|
||||
* @param finishSpanOnClose Whether to automatically finish the span when the scope is closed.
|
||||
*/
|
||||
activate(span: Span, finishSpanOnClose?: boolean): Scope;
|
||||
}
|
||||
|
||||
declare class Scope {
|
||||
/**
|
||||
* Get the span wrapped by this scope.
|
||||
*/
|
||||
span(): Span;
|
||||
|
||||
/**
|
||||
* Close the scope, and finish the span if the scope was created with `finishSpanOnClose` set to true.
|
||||
*/
|
||||
close(): void;
|
||||
}
|
||||
|
||||
-121
@@ -1,121 +0,0 @@
|
||||
import Tracer = require('./tracer');
|
||||
import SpanContext = require('./span_context');
|
||||
import { Span } from 'opentracing';
|
||||
|
||||
declare class DatadogSpan extends Span {
|
||||
/**
|
||||
* Returns the SpanContext object associated with this Span.
|
||||
*/
|
||||
context(): SpanContext;
|
||||
|
||||
/**
|
||||
* Returns the Tracer object used to create this Span.
|
||||
*/
|
||||
tracer(): Tracer;
|
||||
|
||||
/**
|
||||
* Sets the string name for the logical operation this span represents.
|
||||
*/
|
||||
setOperationName(name: string): this;
|
||||
|
||||
/**
|
||||
* Sets a key:value pair on this Span that also propagates to future
|
||||
* children of the associated Span.
|
||||
*
|
||||
* setBaggageItem() enables powerful functionality given a full-stack
|
||||
* opentracing integration (e.g., arbitrary application data from a web
|
||||
* client can make it, transparently, all the way into the depths of a
|
||||
* storage system), and with it some powerful costs: use this feature with
|
||||
* care.
|
||||
*
|
||||
* IMPORTANT NOTE #1: setBaggageItem() will only propagate baggage items to
|
||||
* *future* causal descendants of the associated Span.
|
||||
*
|
||||
* IMPORTANT NOTE #2: Use this thoughtfully and with care. Every key and
|
||||
* value is copied into every local *and remote* child of the associated
|
||||
* Span, and that can add up to a lot of network and cpu overhead.
|
||||
*/
|
||||
setBaggageItem(key: string, value: string): this;
|
||||
|
||||
/**
|
||||
* Returns the value for a baggage item given its key.
|
||||
*
|
||||
* @param key
|
||||
* The key for the given trace attribute.
|
||||
* @return String value for the given key, or undefined if the key does not
|
||||
* correspond to a set trace attribute.
|
||||
*/
|
||||
getBaggageItem(key: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Adds a single tag to the span. See `addTags()` for details.
|
||||
*/
|
||||
setTag(key: string, value: any): this;
|
||||
|
||||
/**
|
||||
* Adds the given key value pairs to the set of span tags.
|
||||
*
|
||||
* Multiple calls to addTags() results in the tags being the superset of
|
||||
* all calls.
|
||||
*
|
||||
* The behavior of setting the same key multiple times on the same span
|
||||
* is undefined.
|
||||
*
|
||||
* The supported type of the values is implementation-dependent.
|
||||
* Implementations are expected to safely handle all types of values but
|
||||
* may choose to ignore unrecognized / unhandle-able values (e.g. objects
|
||||
* with cyclic references, function objects).
|
||||
*/
|
||||
addTags(keyValueMap: {
|
||||
[key: string]: any;
|
||||
}): this;
|
||||
|
||||
/**
|
||||
* Add a log record to this Span, optionally at a user-provided timestamp.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* span.log({
|
||||
* size: rpc.size(), // numeric value
|
||||
* URI: rpc.URI(), // string value
|
||||
* payload: rpc.payload(), // Object value
|
||||
* "keys can be arbitrary strings": rpc.foo(),
|
||||
* });
|
||||
*
|
||||
* span.log({
|
||||
* "error.description": someError.description(),
|
||||
* }, someError.timestampMillis());
|
||||
*
|
||||
* @param keyValuePairs
|
||||
* An object mapping string keys to arbitrary value types. All
|
||||
* Tracer implementations should support bool, string, and numeric
|
||||
* value types, and some may also support Object values.
|
||||
* @param timestamp
|
||||
* An optional parameter specifying the timestamp in milliseconds
|
||||
* since the Unix epoch. Fractional values are allowed so that
|
||||
* timestamps with sub-millisecond accuracy can be represented. If
|
||||
* not specified, the implementation is expected to use its notion
|
||||
* of the current time of the call.
|
||||
*/
|
||||
|
||||
log(keyValuePairs: {
|
||||
[key: string]: any;
|
||||
}, timestamp?: number): this;
|
||||
|
||||
/**
|
||||
* Sets the end timestamp and finalizes Span state.
|
||||
*
|
||||
* With the exception of calls to Span.context() (which are always allowed),
|
||||
* finish() must be the last call made to any span instance, and to do
|
||||
* otherwise leads to undefined behavior.
|
||||
*
|
||||
* @param finishTime
|
||||
* Optional finish time in milliseconds as a Unix timestamp. Decimal
|
||||
* values are supported for timestamps with sub-millisecond accuracy.
|
||||
* If not specified, the current time (as defined by the
|
||||
* implementation) will be used.
|
||||
*/
|
||||
finish(finishTime?: number): void;
|
||||
}
|
||||
|
||||
export = DatadogSpan;
|
||||
@@ -1,40 +0,0 @@
|
||||
import { SpanContext } from 'opentracing';
|
||||
|
||||
/**
|
||||
* SpanContext represents Span state that must propagate to descendant Spans
|
||||
* and across process boundaries.
|
||||
*
|
||||
* SpanContext is logically divided into two pieces: the user-level "Baggage"
|
||||
* (see setBaggageItem and getBaggageItem) that propagates across Span
|
||||
* boundaries and any Tracer-implementation-specific fields that are needed to
|
||||
* identify or otherwise contextualize the associated Span instance (e.g., a
|
||||
* <trace_id, span_id, sampled> tuple).
|
||||
*/
|
||||
declare class DatadogSpanContext extends SpanContext {
|
||||
/**
|
||||
* Use to create references to parent spans.
|
||||
*/
|
||||
constructor(props: SpanContextLike);
|
||||
|
||||
public traceId: number;
|
||||
|
||||
public spanId: number;
|
||||
|
||||
public parentId?: number | null;
|
||||
|
||||
public sampled?: boolean;
|
||||
|
||||
public baggageItems?: { [key: string]: string };
|
||||
|
||||
public trace?: {
|
||||
started: number[],
|
||||
finished: number[]
|
||||
}
|
||||
}
|
||||
|
||||
interface SpanContextLike {
|
||||
traceId: number;
|
||||
spanId: number;
|
||||
}
|
||||
|
||||
export = DatadogSpanContext;
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
import { Tracer } from 'opentracing';
|
||||
|
||||
/**
|
||||
* Tracer is the entry-point between the instrumentation API and the tracing
|
||||
* implementation.
|
||||
*/
|
||||
declare class DatadogTracer extends Tracer {
|
||||
|
||||
}
|
||||
|
||||
export = DatadogTracer;
|
||||
Vendored
+1
-1
@@ -45,7 +45,7 @@ declare class Class_DgramSocket extends Class_EventEmitter {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
bind(opts: Object): void;
|
||||
bind(opts: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+3
-13
@@ -52,23 +52,13 @@ declare class Class_Digest extends Class__object {
|
||||
/**
|
||||
*
|
||||
* @brief 计算并返回摘要
|
||||
* @param data 二进制数据块,此数据块将在计算前更新进摘要
|
||||
* @return 返回摘要的二进制数据
|
||||
* @param codec 指定编码格式,允许值为:"buffer", "hex", "base64", "utf8", 或者系统支持的字符集
|
||||
* @return 返回指定编码的摘要表示
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
digest(data: Class_Buffer): Class_Buffer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 计算并返回摘要
|
||||
* @return 返回摘要的二进制数据
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
digest(): Class_Buffer;
|
||||
digest(codec?: string/** = "buffer"*/): any;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
|
||||
+17
-17
@@ -56,7 +56,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
on(ev: string, func: Function): Object;
|
||||
on(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,7 +67,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
on(map: Object): Object;
|
||||
on(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -79,7 +79,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
addListener(ev: string, func: Function): Object;
|
||||
addListener(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -90,7 +90,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
addListener(map: Object): Object;
|
||||
addListener(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -102,7 +102,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
prependListener(ev: string, func: Function): Object;
|
||||
prependListener(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -113,7 +113,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
prependListener(map: Object): Object;
|
||||
prependListener(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -125,7 +125,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
once(ev: string, func: Function): Object;
|
||||
once(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -136,7 +136,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
once(map: Object): Object;
|
||||
once(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -148,7 +148,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
prependOnceListener(ev: string, func: Function): Object;
|
||||
prependOnceListener(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -159,7 +159,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
prependOnceListener(map: Object): Object;
|
||||
prependOnceListener(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -171,7 +171,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
off(ev: string, func: Function): Object;
|
||||
off(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -182,7 +182,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
off(ev: string): Object;
|
||||
off(ev: string): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -193,7 +193,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
off(map: Object): Object;
|
||||
off(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -205,7 +205,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
removeListener(ev: string, func: Function): Object;
|
||||
removeListener(ev: string, func: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -216,7 +216,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
removeListener(ev: string): Object;
|
||||
removeListener(ev: string): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -227,7 +227,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
removeListener(map: Object): Object;
|
||||
removeListener(map: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -238,7 +238,7 @@ declare class Class_EventEmitter extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): Object;
|
||||
removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -70,7 +70,7 @@ declare class Class_EventInfo extends Class__object {
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
target: Object
|
||||
target: object
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -44,7 +44,7 @@ declare class Class_Handler extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(map: Object);
|
||||
constructor(map: object);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -81,7 +81,7 @@ declare class Class_HandlerEx extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
onerror(hdlrs: Object): void;
|
||||
onerror(hdlrs: object): void;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ declare class Class_HeapSnapshot extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
diff(before: Class_HeapSnapshot): Object;
|
||||
diff(before: Class_HeapSnapshot): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+30
-6
@@ -96,6 +96,30 @@ declare class Class_HttpClient extends Class__object {
|
||||
|
||||
userAgent: string
|
||||
|
||||
/**
|
||||
* class prop
|
||||
*
|
||||
*
|
||||
* @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128
|
||||
*
|
||||
*
|
||||
* @type Integer
|
||||
*/
|
||||
|
||||
poolSize: number
|
||||
|
||||
/**
|
||||
* class prop
|
||||
*
|
||||
*
|
||||
* @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms
|
||||
*
|
||||
*
|
||||
* @type Integer
|
||||
*/
|
||||
|
||||
poolTimeout: number
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -139,7 +163,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -161,7 +185,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -183,7 +207,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -205,7 +229,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -227,7 +251,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -249,7 +273,7 @@ declare class Class_HttpClient extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ declare class Class_HttpCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
add(map: Object): void;
|
||||
add(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -96,7 +96,7 @@ declare class Class_HttpCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
set(map: Object): void;
|
||||
set(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -118,7 +118,7 @@ declare class Class_HttpCookie extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(opts?: Object/** = v8::Object::New(isolate)*/);
|
||||
constructor(opts?: object/** = v8::Object::New(isolate)*/);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -130,7 +130,7 @@ declare class Class_HttpCookie extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(name: string, value: string, opts?: Object/** = v8::Object::New(isolate)*/);
|
||||
constructor(name: string, value: string, opts?: object/** = v8::Object::New(isolate)*/);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -151,7 +151,7 @@ declare class Class_HttpMessage extends Class_Message {
|
||||
*
|
||||
*
|
||||
*/
|
||||
addHeader(map: Object): void;
|
||||
addHeader(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -172,7 +172,7 @@ declare class Class_HttpMessage extends Class_Message {
|
||||
*
|
||||
*
|
||||
*/
|
||||
setHeader(map: Object): void;
|
||||
setHeader(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ declare class Class_HttpResponse extends Class_HttpMessage {
|
||||
*
|
||||
*
|
||||
*/
|
||||
writeHead(statusCode: number, statusMessage: string, headers?: Object/** = v8::Object::New(isolate)*/): void;
|
||||
writeHead(statusCode: number, statusMessage: string, headers?: object/** = v8::Object::New(isolate)*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -91,7 +91,7 @@ declare class Class_HttpResponse extends Class_HttpMessage {
|
||||
*
|
||||
*
|
||||
*/
|
||||
writeHead(statusCode: number, headers?: Object/** = v8::Object::New(isolate)*/): void;
|
||||
writeHead(statusCode: number, headers?: object/** = v8::Object::New(isolate)*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -143,7 +143,7 @@ declare class Class_HttpServer extends Class_TcpServer {
|
||||
*
|
||||
*
|
||||
*/
|
||||
onerror(hdlrs: Object): void;
|
||||
onerror(hdlrs: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -78,7 +78,7 @@ declare class Class_LevelDB extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
mset(map: Object): void;
|
||||
mset(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -134,7 +134,7 @@ declare class Class_LruCache extends Class_EventEmitter {
|
||||
*
|
||||
*
|
||||
*/
|
||||
set(map: Object): void;
|
||||
set(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
+14
-14
@@ -36,7 +36,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
find(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Class_MongoCursor;
|
||||
find(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): Class_MongoCursor;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -48,7 +48,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
findOne(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Object;
|
||||
findOne(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -59,7 +59,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
findAndModify(query: Object): Object;
|
||||
findAndModify(query: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -79,7 +79,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
insert(document: Object): void;
|
||||
insert(document: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -89,7 +89,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
save(document: Object): void;
|
||||
save(document: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -102,7 +102,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
update(query: Object, document: Object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void;
|
||||
update(query: object, document: object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -114,7 +114,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
update(query: Object, document: Object, options: Object): void;
|
||||
update(query: object, document: object, options: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -124,7 +124,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
remove(query: Object): void;
|
||||
remove(query: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -135,7 +135,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
runCommand(cmd: Object): Object;
|
||||
runCommand(cmd: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -147,7 +147,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
runCommand(cmd: string, arg?: Object/** = v8::Object::New(isolate)*/): Object;
|
||||
runCommand(cmd: string, arg?: object/** = v8::Object::New(isolate)*/): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -166,7 +166,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
ensureIndex(keys: Object, options?: Object/** = v8::Object::New(isolate)*/): void;
|
||||
ensureIndex(keys: object, options?: object/** = v8::Object::New(isolate)*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -176,7 +176,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
reIndex(): Object;
|
||||
reIndex(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -187,7 +187,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
dropIndex(name: string): Object;
|
||||
dropIndex(name: string): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -197,7 +197,7 @@ declare class Class_MongoCollection extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
dropIndexes(): Object;
|
||||
dropIndexes(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+3
-3
@@ -57,7 +57,7 @@ declare class Class_MongoCursor extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
sort(opts: Object): Class_MongoCursor;
|
||||
sort(opts: object): Class_MongoCursor;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -77,7 +77,7 @@ declare class Class_MongoCursor extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
next(): Object;
|
||||
next(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -140,7 +140,7 @@ declare class Class_MongoCursor extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
hint(opts: Object): Class_MongoCursor;
|
||||
hint(opts: object): Class_MongoCursor;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -46,7 +46,7 @@ declare class Class_MongoDB extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
runCommand(cmd: Object): Object;
|
||||
runCommand(cmd: object): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -58,7 +58,7 @@ declare class Class_MongoDB extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
runCommand(cmd: string, arg: any): Object;
|
||||
runCommand(cmd: string, arg: any): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+3
-3
@@ -144,7 +144,7 @@ declare class Class_PKey extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(jsonKey: Object);
|
||||
constructor(jsonKey: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -258,7 +258,7 @@ declare class Class_PKey extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
importKey(jsonKey: Object): void;
|
||||
importKey(jsonKey: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -299,7 +299,7 @@ declare class Class_PKey extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
exportJson(): Object;
|
||||
exportJson(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+6
-6
@@ -90,7 +90,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
mset(kvs: Object): void;
|
||||
mset(kvs: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -108,7 +108,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
msetNX(kvs: Object): void;
|
||||
msetNX(kvs: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -383,7 +383,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
sub(map: Object): void;
|
||||
sub(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -424,7 +424,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
unsub(map: Object): void;
|
||||
unsub(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -445,7 +445,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
psub(map: Object): void;
|
||||
psub(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -486,7 +486,7 @@ declare class Class_Redis extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
unpsub(map: Object): void;
|
||||
unpsub(map: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -53,7 +53,7 @@ declare class Class_RedisHash extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
mset(kvs: Object): void;
|
||||
mset(kvs: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ declare class Class_RedisSortedSet extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
add(sms: Object): number;
|
||||
add(sms: object): number;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+10
-10
@@ -34,7 +34,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(map?: Object/** = v8::Object::New(isolate)*/);
|
||||
constructor(map?: object/** = v8::Object::New(isolate)*/);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -45,7 +45,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(method: string, map: Object);
|
||||
constructor(method: string, map: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,7 +67,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
append(map: Object): Class_Routing;
|
||||
append(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -103,7 +103,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
all(map: Object): Class_Routing;
|
||||
all(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -126,7 +126,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
get(map: Object): Class_Routing;
|
||||
get(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -149,7 +149,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
post(map: Object): Class_Routing;
|
||||
post(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -172,7 +172,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
del(map: Object): Class_Routing;
|
||||
del(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -195,7 +195,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
put(map: Object): Class_Routing;
|
||||
put(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -218,7 +218,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
patch(map: Object): Class_Routing;
|
||||
patch(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -241,7 +241,7 @@ declare class Class_Routing extends Class_Handler {
|
||||
*
|
||||
*
|
||||
*/
|
||||
find(map: Object): Class_Routing;
|
||||
find(map: object): Class_Routing;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+84
-6
@@ -34,7 +34,20 @@ declare class Class_SandBox extends Class__object {
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
global: Object
|
||||
global: object
|
||||
|
||||
/**
|
||||
* class prop
|
||||
*
|
||||
*
|
||||
* @brief 查询沙箱中现存的所有模块的字典对象
|
||||
*
|
||||
*
|
||||
* @readonly
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
modules: object
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +59,7 @@ declare class Class_SandBox extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(mods: Object);
|
||||
constructor(mods: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -57,7 +70,7 @@ declare class Class_SandBox extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(mods: Object, require: Function);
|
||||
constructor(mods: object, require: Function);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -68,7 +81,7 @@ declare class Class_SandBox extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(mods: Object, global: Object);
|
||||
constructor(mods: object, global: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -80,7 +93,7 @@ declare class Class_SandBox extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(mods: Object, require: Function, global: Object);
|
||||
constructor(mods: object, require: Function, global: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -101,7 +114,7 @@ declare class Class_SandBox extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
add(mods: Object): void;
|
||||
add(mods: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -125,6 +138,17 @@ declare class Class_SandBox extends Class__object {
|
||||
*/
|
||||
remove(id: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 从沙箱中检测基础模块是否存在
|
||||
* @param id 指定要检测的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名
|
||||
* @return 是否存在
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
has(id: string): boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 复制当前沙箱,新沙箱包含当前沙箱的模块,以及相同的名称和 require 函数
|
||||
@@ -135,6 +159,22 @@ declare class Class_SandBox extends Class__object {
|
||||
*/
|
||||
clone(): Class_SandBox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 冻结当前沙箱,冻结后的沙箱,对 global 所做的修改将被忽略
|
||||
*
|
||||
*
|
||||
*/
|
||||
freeze(): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 重新加载沙箱内的模块,此操作只会重新初始化模块,复位模块内的变量,不更新模块代码
|
||||
*
|
||||
*
|
||||
*/
|
||||
refresh(): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 运行一个脚本
|
||||
@@ -170,6 +210,44 @@ declare class Class_SandBox extends Class__object {
|
||||
*/
|
||||
require(id: string, base: string): any;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 对指定的 extname 添加 compiler, extname 不可为系统内置扩展名 (包括 {'.js', '.json', '.jsc', '.wasm'}), compiler 需返回有效的 javascript 脚本.
|
||||
*
|
||||
* ```JavaScript
|
||||
* var vm = require('vm');
|
||||
* var sbox = new vm.SandBox({
|
||||
* });
|
||||
*
|
||||
* // 编译 typescript 脚本为 js 并加载
|
||||
* sbox.setModuleCompiler('.ts', tsCompiler);
|
||||
* var mod_ts = sbox.require('./a.ts');
|
||||
*
|
||||
* // 编译 coffee 脚本为 js 并加载
|
||||
* sbox.setModuleCompiler('.coffee', cafeCompiler);
|
||||
* var mod_coffee = sbox.require('./a.coffee');
|
||||
*
|
||||
* // 编译 jsx 脚本为 js 并加载
|
||||
* sbox.setModuleCompiler('.jsx', reactCompiler);
|
||||
* var mod_react = sbox.require('./a.jsx');
|
||||
*
|
||||
* // 编译 yml 脚本为自定义的内容(如 API 集合) 并加载
|
||||
* sbox.setModuleCompiler('.yml', yaml2Rest)
|
||||
* sbox.setModuleCompiler('.yaml', yaml2Rest)
|
||||
*
|
||||
* // 编译 markdown 为自定义的内容(如 html 字符串或 XmlDocument 对象) 并加载
|
||||
* sbox.setModuleCompiler('.md', mdCompiler)
|
||||
* sbox.setModuleCompiler('.markdown', mdCompiler)
|
||||
* ```
|
||||
*
|
||||
* @param extname 指定的 extname, 必须以 '.' 开头, 且为非系统内置扩展名
|
||||
* @param compiler 编译回调函数, 所有带 extname 的文件仅会 require 一次. 该回调函数格式为 `compiler(buf, requireInfo)`, buf 为读取到的文件 Buffer, requireInfo 结构为 `{filename: string}`.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
setModuleCompiler(extname: string, compiler: Function): void;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
/** endof `module Or Internal Object` */
|
||||
|
||||
Vendored
+1
-1
@@ -84,7 +84,7 @@ declare class Class_Service extends Class_EventEmitter {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(name: string, worker: Function, event?: Object/** = v8::Object::New(isolate)*/);
|
||||
constructor(name: string, worker: Function, event?: object/** = v8::Object::New(isolate)*/);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -216,7 +216,7 @@ declare class Class_UrlObject extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(args: Object);
|
||||
constructor(args: object);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -250,7 +250,7 @@ declare class Class_UrlObject extends Class__object {
|
||||
*
|
||||
*
|
||||
*/
|
||||
format(args: Object): void;
|
||||
format(args: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -47,7 +47,7 @@ declare class Class_Worker extends Class_EventEmitter {
|
||||
*
|
||||
*
|
||||
*/
|
||||
constructor(path: string, opts?: Object/** = v8::Object::New(isolate)*/);
|
||||
constructor(path: string, opts?: object/** = v8::Object::New(isolate)*/);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -146,7 +146,7 @@ declare class Class_X509Req extends Class__object {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
sign(issuer: string, key: Class_PKey, opts?: Object/** = v8::Object::New(isolate)*/): Class_X509Cert;
|
||||
sign(issuer: string, key: Class_PKey, opts?: object/** = v8::Object::New(isolate)*/): Class_X509Cert;
|
||||
|
||||
} /** endof class */
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -217,7 +217,7 @@ declare module "bson" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function encode(data: Object): Class_Buffer;
|
||||
export function encode(data: object): Class_Buffer;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -228,7 +228,7 @@ declare module "bson" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function decode(data: Class_Buffer): Object;
|
||||
export function decode(data: Class_Buffer): object;
|
||||
|
||||
} /** end of `module bson` */
|
||||
export = bson
|
||||
|
||||
Vendored
+1
-1
@@ -391,7 +391,7 @@ declare module "console" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function add(cfg: Object): void;
|
||||
export function add(cfg: object): void;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -238,7 +238,7 @@ declare module "dgram" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function createSocket(opts: Object): Class_DgramSocket;
|
||||
export function createSocket(opts: object): Class_DgramSocket;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -260,7 +260,7 @@ declare module "dgram" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function createSocket(opts: Object, callback: Function): Class_DgramSocket;
|
||||
export function createSocket(opts: object, callback: Function): Class_DgramSocket;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+21
@@ -647,6 +647,27 @@ declare module "fs" {
|
||||
*/
|
||||
export function appendFile(fname: string, data: Class_Buffer): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 设置 zip 虚拟文件映射
|
||||
* @param fname 指定映射路径
|
||||
* @param data 指定映射的 zip 文件数据
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function setZipFS(fname: string, data: Class_Buffer): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 清除 zip 虚拟文件映射
|
||||
* @param fname 指定映射路径,缺省清除全部缓存
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function clearZipFS(fname?: string/** = ""*/): void;
|
||||
|
||||
} /** end of `module fs` */
|
||||
export = fs
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -379,7 +379,7 @@ declare module "global" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer;
|
||||
export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -293,7 +293,7 @@ declare module "gui" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function open(url: string, opt?: Object/** = v8::Object::New(isolate)*/): Class_WebView;
|
||||
export function open(url: string, opt?: object/** = v8::Object::New(isolate)*/): Class_WebView;
|
||||
|
||||
} /** end of `module gui` */
|
||||
export = gui
|
||||
|
||||
Vendored
+32
-8
@@ -196,7 +196,7 @@
|
||||
|
||||
/** module Or Internal Object */
|
||||
/**
|
||||
* @brief 超文本传输协议模块,用以支持 http 协议处理
|
||||
* @brief 超文本传输协议模块,用以支持 http 协议处理,模块别名:https
|
||||
* @detail
|
||||
*/
|
||||
declare module "http" {
|
||||
@@ -205,6 +205,14 @@ declare module "http" {
|
||||
module http {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 返回标准的 HTTP 响应状态码的集合,以及各自的简短描述。
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const STATUS_CODES: any[];
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 返回http客户端的 HttpCookie 对象列表
|
||||
@@ -253,6 +261,22 @@ declare module "http" {
|
||||
*/
|
||||
export const userAgent: string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const poolSize: number;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms
|
||||
*
|
||||
*
|
||||
*/
|
||||
export const poolTimeout: number;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -333,7 +357,7 @@ declare module "http" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function fileHandler(root: string, mimes?: Object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler;
|
||||
export function fileHandler(root: string, mimes?: object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -368,7 +392,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -390,7 +414,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -412,7 +436,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -434,7 +458,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -456,7 +480,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -478,7 +502,7 @@ declare module "http" {
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
export function patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse;
|
||||
|
||||
} /** end of `module http` */
|
||||
export = http
|
||||
|
||||
Vendored
+34
-34
@@ -14,54 +14,54 @@
|
||||
|
||||
|
||||
|
||||
/// <reference path="assert.d.ts" />
|
||||
/// <reference path="console.d.ts" />
|
||||
/// <reference path="coroutine.d.ts" />
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="gui.d.ts" />
|
||||
/// <reference path="os.d.ts" />
|
||||
/// <reference path="process.d.ts" />
|
||||
/// <reference path="registry.d.ts" />
|
||||
/// <reference path="timers.d.ts" />
|
||||
/// <reference path="tty.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="io.d.ts" />
|
||||
/// <reference path="path.d.ts" />
|
||||
/// <reference path="path_posix.d.ts" />
|
||||
/// <reference path="path_win32.d.ts" />
|
||||
/// <reference path="dgram.d.ts" />
|
||||
/// <reference path="dns.d.ts" />
|
||||
/// <reference path="http.d.ts" />
|
||||
/// <reference path="mq.d.ts" />
|
||||
/// <reference path="net.d.ts" />
|
||||
/// <reference path="punycode.d.ts" />
|
||||
/// <reference path="querystring.d.ts" />
|
||||
/// <reference path="ssl.d.ts" />
|
||||
/// <reference path="url.d.ts" />
|
||||
/// <reference path="ws.d.ts" />
|
||||
/// <reference path="zmq.d.ts" />
|
||||
/// <reference path="base32.d.ts" />
|
||||
/// <reference path="base64.d.ts" />
|
||||
/// <reference path="base64vlq.d.ts" />
|
||||
/// <reference path="bson.d.ts" />
|
||||
/// <reference path="console.d.ts" />
|
||||
/// <reference path="constants.d.ts" />
|
||||
/// <reference path="coroutine.d.ts" />
|
||||
/// <reference path="crypto.d.ts" />
|
||||
/// <reference path="db.d.ts" />
|
||||
/// <reference path="dgram.d.ts" />
|
||||
/// <reference path="dns.d.ts" />
|
||||
/// <reference path="encoding.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="gd.d.ts" />
|
||||
/// <reference path="global.d.ts" />
|
||||
/// <reference path="gui.d.ts" />
|
||||
/// <reference path="hash.d.ts" />
|
||||
/// <reference path="hex.d.ts" />
|
||||
/// <reference path="http.d.ts" />
|
||||
/// <reference path="iconv.d.ts" />
|
||||
/// <reference path="io.d.ts" />
|
||||
/// <reference path="json.d.ts" />
|
||||
/// <reference path="mq.d.ts" />
|
||||
/// <reference path="net.d.ts" />
|
||||
/// <reference path="os.d.ts" />
|
||||
/// <reference path="path.d.ts" />
|
||||
/// <reference path="path_posix.d.ts" />
|
||||
/// <reference path="path_win32.d.ts" />
|
||||
/// <reference path="process.d.ts" />
|
||||
/// <reference path="profiler.d.ts" />
|
||||
/// <reference path="punycode.d.ts" />
|
||||
/// <reference path="querystring.d.ts" />
|
||||
/// <reference path="registry.d.ts" />
|
||||
/// <reference path="ssl.d.ts" />
|
||||
/// <reference path="string_decoder.d.ts" />
|
||||
/// <reference path="crypto.d.ts" />
|
||||
/// <reference path="hash.d.ts" />
|
||||
/// <reference path="zip.d.ts" />
|
||||
/// <reference path="zlib.d.ts" />
|
||||
/// <reference path="assert.d.ts" />
|
||||
/// <reference path="profiler.d.ts" />
|
||||
/// <reference path="test.d.ts" />
|
||||
/// <reference path="timers.d.ts" />
|
||||
/// <reference path="tty.d.ts" />
|
||||
/// <reference path="url.d.ts" />
|
||||
/// <reference path="db.d.ts" />
|
||||
/// <reference path="gd.d.ts" />
|
||||
/// <reference path="util.d.ts" />
|
||||
/// <reference path="uuid.d.ts" />
|
||||
/// <reference path="vm.d.ts" />
|
||||
/// <reference path="ws.d.ts" />
|
||||
/// <reference path="xml.d.ts" />
|
||||
/// <reference path="zip.d.ts" />
|
||||
/// <reference path="zlib.d.ts" />
|
||||
/// <reference path="zmq.d.ts" />
|
||||
/// <reference path="constants.d.ts" />
|
||||
|
||||
import _Global from 'global';
|
||||
import _Process from 'process';
|
||||
|
||||
Vendored
+1
-1
@@ -284,7 +284,7 @@ declare module "net" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function info(): Object;
|
||||
export function info(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+3
-3
@@ -380,7 +380,7 @@ declare module "os" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function userInfo(options?: Object/** = v8::Object::New(isolate)*/): Object;
|
||||
export function userInfo(options?: object/** = v8::Object::New(isolate)*/): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -390,7 +390,7 @@ declare module "os" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function networkInterfaces(): Object;
|
||||
export function networkInterfaces(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -470,7 +470,7 @@ declare module "os" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function memoryUsage(): Object;
|
||||
export function memoryUsage(): object;
|
||||
|
||||
} /** end of `module os` */
|
||||
export = os
|
||||
|
||||
Vendored
+13
@@ -341,6 +341,19 @@ declare module "path" {
|
||||
*/
|
||||
export function resolve(...ps: any[]): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 求 _from 到 to 的相对路径
|
||||
*
|
||||
* @param _from 源路径
|
||||
* @param to 目标路径
|
||||
* @return 返回得到的相对路径
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function relative(_from: string, to: string): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。
|
||||
|
||||
Vendored
+13
@@ -341,6 +341,19 @@ declare module "path_posix" {
|
||||
*/
|
||||
export function resolve(...ps: any[]): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 求 _from 到 to 的相对路径
|
||||
*
|
||||
* @param _from 源路径
|
||||
* @param to 目标路径
|
||||
* @return 返回得到的相对路径
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function relative(_from: string, to: string): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。
|
||||
|
||||
Vendored
+13
@@ -341,6 +341,19 @@ declare module "path_win32" {
|
||||
*/
|
||||
export function resolve(...ps: any[]): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 求 _from 到 to 的相对路径
|
||||
*
|
||||
* @param _from 源路径
|
||||
* @param to 目标路径
|
||||
* @return 返回得到的相对路径
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function relative(_from: string, to: string): string;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。
|
||||
|
||||
Vendored
+7
-7
@@ -416,7 +416,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function memoryUsage(): Object;
|
||||
export function memoryUsage(): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -448,7 +448,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function open(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
export function open(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -468,7 +468,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function open(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
export function open(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -489,7 +489,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function start(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
export function start(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -509,7 +509,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function start(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
export function start(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -530,7 +530,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function run(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): number;
|
||||
export function run(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): number;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -550,7 +550,7 @@ declare module "process" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function run(command: string, opts?: Object/** = v8::Object::New(isolate)*/): number;
|
||||
export function run(command: string, opts?: object/** = v8::Object::New(isolate)*/): number;
|
||||
|
||||
} /** end of `module process` */
|
||||
export = process
|
||||
|
||||
Vendored
+1
-1
@@ -416,7 +416,7 @@ declare module "profiler" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function diff(test: Function): Object;
|
||||
export function diff(test: Function): object;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -242,7 +242,7 @@ declare module "querystring" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): Class_HttpCollection;
|
||||
export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): Class_HttpCollection;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -256,7 +256,7 @@ declare module "querystring" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function stringify(obj: Object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): string;
|
||||
export function stringify(obj: object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): string;
|
||||
|
||||
} /** end of `module querystring` */
|
||||
export = querystring
|
||||
|
||||
Vendored
+1
-1
@@ -196,7 +196,7 @@
|
||||
|
||||
/** module Or Internal Object */
|
||||
/**
|
||||
* @brief ssl/tls 模块
|
||||
* @brief ssl/tls 模块,模块别名:tls
|
||||
* @detail
|
||||
*/
|
||||
declare module "ssl" {
|
||||
|
||||
Vendored
+14
-1
@@ -219,7 +219,7 @@ declare module "timers" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer;
|
||||
export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -313,6 +313,19 @@ declare module "timers" {
|
||||
*/
|
||||
export function clearImmediate(t: any): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 调用给定的函数,并在超时时间到期时中断函数运行
|
||||
* @param func 指定要运行的函数
|
||||
* @param timeout 指定超时时间
|
||||
* @param args 额外的参数,传入到指定的 callback 内,可选。
|
||||
* @return 返回 func 的运行结果
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function call(func: Function, timeout: number, ...args: any[]): any;
|
||||
|
||||
} /** end of `module timers` */
|
||||
export = timers
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -217,7 +217,7 @@ declare module "url" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function format(args: Object): string;
|
||||
export function format(args: object): string;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Vendored
+27
-13
@@ -274,7 +274,7 @@ declare module "util" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function inspect(obj: Object, options?: Object/** = v8::Object::New(isolate)*/): string;
|
||||
export function inspect(obj: object, options?: object/** = v8::Object::New(isolate)*/): string;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -637,6 +637,17 @@ declare module "util" {
|
||||
*/
|
||||
export function clone(v: any): any;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 深度冻结一个对象,被冻结后的对象及其包含的对象都将不允许修改
|
||||
*
|
||||
* @param v 指定要冻结的对象
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function deepFreeze(v: any): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 将一个或者多个对象的键值扩展到指定对象
|
||||
@@ -674,7 +685,7 @@ declare module "util" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function pick(v: any, ...objs: any[]): Object;
|
||||
export function pick(v: any, ...objs: any[]): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -687,7 +698,7 @@ declare module "util" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function omit(v: any, ...keys: any[]): Object;
|
||||
export function omit(v: any, ...keys: any[]): object;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -937,22 +948,25 @@ declare module "util" {
|
||||
*
|
||||
* ```JavaScript
|
||||
* {
|
||||
* "fibjs": "0.1.0",
|
||||
* "svn": 1753,
|
||||
* "build": "Dec 10 2013 21:44:17",
|
||||
* "fibjs": "0.25.0",
|
||||
* "clang": "9.1",
|
||||
* "date": "Jun 12 2018 07:22:40",
|
||||
* "vender": {
|
||||
* "ev": "4.11",
|
||||
* "exif": "0.6.21",
|
||||
* "gd": "2.1.0-alpha",
|
||||
* "ev": "4.24",
|
||||
* "expat": "2.2.5",
|
||||
* "gd": "2.2.4",
|
||||
* "jpeg": "8.3",
|
||||
* "log4cpp": "1.0",
|
||||
* "leveldb": "1.17",
|
||||
* "mongo": "0.7",
|
||||
* "pcre": "8.21",
|
||||
* "png": "1.5.4",
|
||||
* "sqlite": "3.8.1",
|
||||
* "mbedtls": "2.6.1",
|
||||
* "snappy": "1.1.2",
|
||||
* "sqlite": "3.23.0",
|
||||
* "tiff": "3.9.5",
|
||||
* "uuid": "1.6.2",
|
||||
* "v8": "3.23.17 (candidate)",
|
||||
* "v8": "6.7.288.20",
|
||||
* "v8-snapshot": true,
|
||||
* "zlib": "1.2.7",
|
||||
* "zmq": "3.1"
|
||||
* }
|
||||
@@ -963,7 +977,7 @@ declare module "util" {
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function buildInfo(): Object;
|
||||
export function buildInfo(): object;
|
||||
|
||||
} /** end of `module util` */
|
||||
export = util
|
||||
|
||||
Vendored
+24
-12
@@ -264,11 +264,12 @@ declare module "zlib" {
|
||||
*
|
||||
* @brief 创建一个 gunzip 流对象
|
||||
* @param to 用于存储处理结果的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回封装过的流对象
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function createGunzip(to: Class_Stream): Class_Stream;
|
||||
export function createGunzip(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -284,21 +285,23 @@ declare module "zlib" {
|
||||
*
|
||||
* @brief 创建一个 inflate 流对象
|
||||
* @param to 用于存储处理结果的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回封装过的流对象
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function createInflate(to: Class_Stream): Class_Stream;
|
||||
export function createInflate(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 创建一个 inflateRaw 流对象
|
||||
* @param to 用于存储处理结果的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回封装过的流对象
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function createInflateRaw(to: Class_Stream): Class_Stream;
|
||||
export function createInflateRaw(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -340,34 +343,37 @@ declare module "zlib" {
|
||||
*
|
||||
* @brief 解压缩 deflate 算法压缩的数据(zlib格式)
|
||||
* @param data 给定压缩后的数据
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回解压缩后的二进制数据
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflate(data: Class_Buffer): Class_Buffer;
|
||||
export function inflate(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩 deflate 算法压缩的数据到流对象中(zlib格式)
|
||||
* @param data 给定要解压缩的数据
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflateTo(data: Class_Buffer, stm: Class_Stream): void;
|
||||
export function inflateTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(zlib格式)
|
||||
* @param src 给定要解压缩的数据所在的流
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflateTo(src: Class_Stream, stm: Class_Stream): void;
|
||||
export function inflateTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -406,34 +412,37 @@ declare module "zlib" {
|
||||
*
|
||||
* @brief 解压缩 gzip 算法压缩的数据
|
||||
* @param data 给定压缩后的数据
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回解压缩后的二进制数据
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function gunzip(data: Class_Buffer): Class_Buffer;
|
||||
export function gunzip(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩 gzip 算法压缩的数据到流对象中
|
||||
* @param data 给定要解压缩的数据
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function gunzipTo(data: Class_Buffer, stm: Class_Stream): void;
|
||||
export function gunzipTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩源流中 gzip 算法压缩的数据到流对象中
|
||||
* @param src 给定要解压缩的数据所在的流
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function gunzipTo(src: Class_Stream, stm: Class_Stream): void;
|
||||
export function gunzipTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -475,34 +484,37 @@ declare module "zlib" {
|
||||
*
|
||||
* @brief 解压缩 deflate 算法压缩的数据(inflateRaw)
|
||||
* @param data 给定压缩后的数据
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
* @return 返回解压缩后的二进制数据
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflateRaw(data: Class_Buffer): Class_Buffer;
|
||||
export function inflateRaw(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩 deflate 算法压缩的数据到流对象中(inflateRaw)
|
||||
* @param data 给定要解压缩的数据
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflateRawTo(data: Class_Buffer, stm: Class_Stream): void;
|
||||
export function inflateRawTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(inflateRaw)
|
||||
* @param src 给定要解压缩的数据所在的流
|
||||
* @param stm 指定存储解压缩数据的流
|
||||
* @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制
|
||||
*
|
||||
*
|
||||
* @async
|
||||
*/
|
||||
export function inflateRawTo(src: Class_Stream, stm: Class_Stream): void;
|
||||
export function inflateRawTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void;
|
||||
|
||||
} /** end of `module zlib` */
|
||||
export = zlib
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for fibjs 0.25
|
||||
// Type definitions for fibjs 0.26
|
||||
// Project: https://github.com/fibjs/fibjs
|
||||
// Definitions by: richardo2016 <https://github.com/richardo2016>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+14
-18
@@ -1,4 +1,4 @@
|
||||
// Type definitions for joi v13.4.0
|
||||
// Type definitions for joi 13.4
|
||||
// Project: https://github.com/hapijs/joi
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Laurence Dougal Myers <https://github.com/laurence-myers>
|
||||
@@ -125,7 +125,7 @@ export interface IpOptions {
|
||||
cidr?: string;
|
||||
}
|
||||
|
||||
export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5'
|
||||
export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5';
|
||||
|
||||
export interface GuidOptions {
|
||||
version: GuidVersions[] | GuidVersions;
|
||||
@@ -181,8 +181,8 @@ export interface ReferenceOptions {
|
||||
}
|
||||
|
||||
export interface IPOptions {
|
||||
version?: Array<string>;
|
||||
cidr?: string
|
||||
version?: string[];
|
||||
cidr?: string;
|
||||
}
|
||||
|
||||
export interface StringRegexOptions {
|
||||
@@ -236,7 +236,6 @@ export type Schema = AnySchema
|
||||
| LazySchema;
|
||||
|
||||
export interface AnySchema extends JoiObject {
|
||||
|
||||
schemaType?: Types | string;
|
||||
|
||||
/**
|
||||
@@ -441,7 +440,6 @@ export interface State {
|
||||
}
|
||||
|
||||
export interface BooleanSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Allows for additional values to be considered valid booleans by converting them to true during validation.
|
||||
* Accepts a value or an array of values. String comparisons are by default case insensitive,
|
||||
@@ -695,7 +693,9 @@ export interface ArraySchema extends AnySchema {
|
||||
/**
|
||||
* Lists the types in sequence order for the array values where:
|
||||
* @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments.
|
||||
* If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly.
|
||||
* If a given type is .required() then there must be a matching item with the same index position in the array.
|
||||
* Errors will contain the number of items that didn't match.
|
||||
* Any unmatched item having a label will be mentioned explicitly.
|
||||
*/
|
||||
ordered(...types: SchemaLike[]): this;
|
||||
ordered(types: SchemaLike[]): this;
|
||||
@@ -726,7 +726,6 @@ export interface ArraySchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface ObjectSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Sets or extends the allowed object keys.
|
||||
*/
|
||||
@@ -754,9 +753,9 @@ export interface ObjectSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Specify validation rules for unknown keys matching a pattern.
|
||||
*
|
||||
* @param pattern - a pattern that can be either a regular expression or a joi schema that will be tested against the unknown key names
|
||||
* @param schema - the schema object matching keys must validate against
|
||||
*
|
||||
* @param pattern - a pattern that can be either a regular expression or a joi schema that will be tested against the unknown key names
|
||||
* @param schema - the schema object matching keys must validate against
|
||||
*/
|
||||
pattern(pattern: RegExp | SchemaLike, schema: SchemaLike): this;
|
||||
|
||||
@@ -884,7 +883,6 @@ export interface BinarySchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface DateSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Specifies the oldest date allowed.
|
||||
* Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date,
|
||||
@@ -927,7 +925,6 @@ export interface DateSchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface FunctionSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Specifies the arity of the function where:
|
||||
* @param n - the arity expected.
|
||||
@@ -961,7 +958,6 @@ export interface AlternativesSchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface LazySchema extends AnySchema {
|
||||
|
||||
}
|
||||
|
||||
export interface Reference extends JoiObject {
|
||||
@@ -982,7 +978,7 @@ export type ExtensionBoundSchema = Schema & {
|
||||
* @param options - should the context passed into the `validate` function in a custom rule
|
||||
*/
|
||||
createError(type: string, context: Context, state: State, options: ValidationOptions): Err;
|
||||
}
|
||||
};
|
||||
|
||||
export interface Rules<P extends object = any> {
|
||||
name: string;
|
||||
@@ -1134,7 +1130,7 @@ export function reach<T extends Schema>(schema: ObjectSchema, path: string[]): T
|
||||
/**
|
||||
* Creates a new Joi instance customized with the extension(s) you provide included.
|
||||
*/
|
||||
export function extend(extension: Extension|Extension[], ...extensions: (Extension|Extension[])[]): any;
|
||||
export function extend(extension: Extension|Extension[], ...extensions: Array<Extension|Extension[]>): any;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
@@ -1160,8 +1156,8 @@ export function defaults(fn: DefaultsFunction): Root;
|
||||
export function describe(schema: Schema): Description;
|
||||
|
||||
/**
|
||||
* Whitelists a value
|
||||
*/
|
||||
* Whitelists a value
|
||||
*/
|
||||
export function allow(value: any, ...values: any[]): Schema;
|
||||
export function allow(values: any[]): Schema;
|
||||
|
||||
|
||||
+29
-36
@@ -3,29 +3,24 @@ import Joi = require('joi');
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
let x: any = null;
|
||||
let value: any = null;
|
||||
let num: number = 0;
|
||||
let str: string = '';
|
||||
let bool: boolean = false;
|
||||
let exp: RegExp = null;
|
||||
let obj: object = null;
|
||||
let date: Date = null;
|
||||
let err: Error = null;
|
||||
let func: Function = null;
|
||||
declare const value: any;
|
||||
let num = 0;
|
||||
let str = '';
|
||||
declare const bool: boolean;
|
||||
declare const exp: RegExp;
|
||||
declare const obj: object;
|
||||
declare const date: Date;
|
||||
declare const err: Error;
|
||||
declare const func: Function;
|
||||
|
||||
let anyArr: any[] = [];
|
||||
let numArr: number[] = [];
|
||||
let strArr: string[] = [];
|
||||
let boolArr: boolean[] = [];
|
||||
let expArr: RegExp[] = [];
|
||||
let objArr: object[] = [];
|
||||
let errArr: Error[] = [];
|
||||
let funcArr: Function[] = [];
|
||||
declare const numArr: number[];
|
||||
declare const strArr: string[];
|
||||
declare const expArr: RegExp[];
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
let schema: Joi.Schema = null;
|
||||
let schemaLike: Joi.SchemaLike = null;
|
||||
declare const schemaLike: Joi.SchemaLike;
|
||||
|
||||
let anySchema: Joi.AnySchema = null;
|
||||
let numSchema: Joi.NumberSchema = null;
|
||||
@@ -38,7 +33,7 @@ let funcSchema: Joi.FunctionSchema = null;
|
||||
let objSchema: Joi.ObjectSchema = null;
|
||||
let altSchema: Joi.AlternativesSchema = null;
|
||||
|
||||
let schemaArr: Joi.Schema[] = [];
|
||||
declare const schemaArr: Joi.Schema[];
|
||||
|
||||
let ref: Joi.Reference = null;
|
||||
let description: Joi.Description = null;
|
||||
@@ -156,7 +151,7 @@ stringRegexOpts = { invert: bool };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
let validErr: Joi.ValidationError = null;
|
||||
declare const validErr: Joi.ValidationError;
|
||||
let validErrItem: Joi.ValidationErrorItem;
|
||||
let validErrFunc: Joi.ValidationErrorFunction;
|
||||
|
||||
@@ -235,13 +230,13 @@ schemaMap = {
|
||||
{ c1: true },
|
||||
{ c2: null }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
anySchema = Joi.any();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
anySchema = anySchema.allow(x);
|
||||
anySchema = anySchema.allow(x, x);
|
||||
anySchema = anySchema.allow([x, x, x]);
|
||||
@@ -323,7 +318,6 @@ arrSchema = arrSchema.unique();
|
||||
arrSchema = arrSchema.unique((a, b) => a.test === b.test);
|
||||
arrSchema = arrSchema.unique('customer.id');
|
||||
|
||||
|
||||
arrSchema = arrSchema.items(numSchema);
|
||||
arrSchema = arrSchema.items(numSchema, strSchema, schemaLike);
|
||||
arrSchema = arrSchema.items([numSchema, strSchema, schemaLike]);
|
||||
@@ -333,7 +327,7 @@ arrSchema = arrSchema.items([schemaMap, schemaMap, schemaLike]);
|
||||
|
||||
// - - - - - - - -
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
// use search & replace from any
|
||||
arrSchema = arrSchema.allow(x);
|
||||
arrSchema = arrSchema.allow(x, x);
|
||||
@@ -387,7 +381,7 @@ namespace common_copy_paste {
|
||||
boolSchema = Joi.bool();
|
||||
boolSchema = Joi.boolean();
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
boolSchema = boolSchema.allow(x);
|
||||
boolSchema = boolSchema.allow(x, x);
|
||||
boolSchema = boolSchema.allow([x, x, x]);
|
||||
@@ -462,7 +456,7 @@ binSchema = binSchema.min(num);
|
||||
binSchema = binSchema.max(num);
|
||||
binSchema = binSchema.length(num);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
binSchema = binSchema.allow(x);
|
||||
binSchema = binSchema.allow(x, x);
|
||||
binSchema = binSchema.allow([x, x, x]);
|
||||
@@ -535,7 +529,7 @@ dateSchema = dateSchema.timestamp();
|
||||
dateSchema = dateSchema.timestamp('javascript');
|
||||
dateSchema = dateSchema.timestamp('unix');
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
dateSchema = dateSchema.allow(x);
|
||||
dateSchema = dateSchema.allow(x, x);
|
||||
dateSchema = dateSchema.allow([x, x, x]);
|
||||
@@ -611,7 +605,7 @@ numSchema = numSchema.positive();
|
||||
numSchema = numSchema.negative();
|
||||
numSchema = numSchema.port();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
numSchema = numSchema.allow(x);
|
||||
numSchema = numSchema.allow(x, x);
|
||||
numSchema = numSchema.allow([x, x, x]);
|
||||
@@ -729,7 +723,7 @@ objSchema = objSchema.forbiddenKeys(str);
|
||||
objSchema = objSchema.forbiddenKeys(str, str);
|
||||
objSchema = objSchema.forbiddenKeys(strArr);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
objSchema = objSchema.allow(x);
|
||||
objSchema = objSchema.allow(x, x);
|
||||
objSchema = objSchema.allow([x, x, x]);
|
||||
@@ -809,7 +803,7 @@ strSchema = strSchema.ip(ipOpts);
|
||||
strSchema = strSchema.uri();
|
||||
strSchema = strSchema.uri(uriOpts);
|
||||
strSchema = strSchema.guid();
|
||||
strSchema = strSchema.guid({ version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5'] } as Joi.GuidOptions);
|
||||
strSchema = strSchema.guid({ version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5'] });
|
||||
strSchema = strSchema.guid({ version: 'uuidv4' });
|
||||
strSchema = strSchema.hex();
|
||||
strSchema = strSchema.hex(hexOpts);
|
||||
@@ -825,7 +819,7 @@ strSchema = strSchema.normalize('NFKC');
|
||||
strSchema = strSchema.base64();
|
||||
strSchema = strSchema.base64(base64Opts);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
strSchema = strSchema.allow(x);
|
||||
strSchema = strSchema.allow(x, x);
|
||||
strSchema = strSchema.allow([x, x, x]);
|
||||
@@ -891,11 +885,11 @@ schema = Joi.alt(schema, anySchema, boolSchema);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
schema = Joi.lazy(() => schema)
|
||||
schema = Joi.lazy(() => schema);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
namespace validate_tests {
|
||||
{ // validate tests
|
||||
{
|
||||
Joi.validate(value, obj);
|
||||
Joi.validate(value, schema);
|
||||
@@ -925,7 +919,7 @@ namespace validate_tests {
|
||||
|
||||
{
|
||||
let value = { username: 'example', password: 'example' };
|
||||
let schema = Joi.object().keys({
|
||||
const schema = Joi.object().keys({
|
||||
username: Joi.string().max(255).required(),
|
||||
password: Joi.string().regex(/^[a-zA-Z0-9]{3,255}$/).required(),
|
||||
});
|
||||
@@ -951,12 +945,11 @@ namespace validate_tests {
|
||||
|
||||
returnValue
|
||||
.then(val => JSON.stringify(val, null, 2))
|
||||
.then(val => { throw 'one error'; })
|
||||
.then(val => { throw new Error('one error'); })
|
||||
.catch(e => {});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
schema = Joi.compile(obj);
|
||||
|
||||
+2
-68
@@ -1,79 +1,13 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
// All are TODOs
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+10
-15
@@ -1,4 +1,4 @@
|
||||
// Type definitions for joi v10.6.0
|
||||
// Type definitions for joi 10.6
|
||||
// Project: https://github.com/hapijs/joi
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Laurence Dougal Myers <https://github.com/laurence-myers>
|
||||
@@ -114,7 +114,7 @@ export interface IpOptions {
|
||||
cidr?: string;
|
||||
}
|
||||
|
||||
export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5'
|
||||
export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5';
|
||||
|
||||
export interface GuidOptions {
|
||||
version: GuidVersions[] | GuidVersions;
|
||||
@@ -160,8 +160,8 @@ export interface ReferenceOptions {
|
||||
}
|
||||
|
||||
export interface IPOptions {
|
||||
version?: Array<string>;
|
||||
cidr?: string
|
||||
version?: string[];
|
||||
cidr?: string;
|
||||
}
|
||||
|
||||
export interface JoiObject {
|
||||
@@ -210,7 +210,6 @@ export type Schema = AnySchema
|
||||
| LazySchema;
|
||||
|
||||
export interface AnySchema extends JoiObject {
|
||||
|
||||
/**
|
||||
* Validates a value using the schema and options.
|
||||
*/
|
||||
@@ -411,7 +410,6 @@ export interface State {
|
||||
}
|
||||
|
||||
export interface BooleanSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Allows for additional values to be considered valid booleans by converting them to true during validation.
|
||||
* Accepts a value or an array of values. String comparisons are by default case insensitive,
|
||||
@@ -514,7 +512,6 @@ export interface StringSchema extends AnySchema {
|
||||
max(limit: number, encoding?: string): this;
|
||||
max(limit: Reference, encoding?: string): this;
|
||||
|
||||
|
||||
/**
|
||||
* Specifies whether the string.max() limit should be used as a truncation.
|
||||
* @param enabled - optional parameter defaulting to true which allows you to reset the behavior of truncate by providing a falsy value.
|
||||
@@ -651,7 +648,9 @@ export interface ArraySchema extends AnySchema {
|
||||
/**
|
||||
* Lists the types in sequence order for the array values where:
|
||||
* @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments.
|
||||
* If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly.
|
||||
* If a given type is .required() then there must be a matching item with the same index position in the array.
|
||||
* Errors will contain the number of items that didn't match.
|
||||
* Any unmatched item having a label will be mentioned explicitly.
|
||||
*/
|
||||
ordered(...types: SchemaLike[]): this;
|
||||
ordered(types: SchemaLike[]): this;
|
||||
@@ -682,7 +681,6 @@ export interface ArraySchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface ObjectSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Sets the allowed object keys.
|
||||
*/
|
||||
@@ -819,7 +817,6 @@ export interface BinarySchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface DateSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Specifies the oldest date allowed.
|
||||
* Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date,
|
||||
@@ -862,7 +859,6 @@ export interface DateSchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface FunctionSchema extends AnySchema {
|
||||
|
||||
/**
|
||||
* Specifies the arity of the function where:
|
||||
* @param n - the arity expected.
|
||||
@@ -896,7 +892,6 @@ export interface AlternativesSchema extends AnySchema {
|
||||
}
|
||||
|
||||
export interface LazySchema extends AnySchema {
|
||||
|
||||
}
|
||||
|
||||
export interface Reference extends JoiObject {
|
||||
@@ -917,7 +912,7 @@ export type ExtensionBoundSchema = Schema & {
|
||||
* @param options - should the context passed into the `validate` function in a custom rule
|
||||
*/
|
||||
createError(type: string, context: Context, state: State, options: ValidationOptions): Err;
|
||||
}
|
||||
};
|
||||
|
||||
export interface Rules<P extends object = any> {
|
||||
name: string;
|
||||
@@ -1078,8 +1073,8 @@ export function extend(extention: Extension): any;
|
||||
export function describe(schema: Schema): Description;
|
||||
|
||||
/**
|
||||
* Whitelists a value
|
||||
*/
|
||||
* Whitelists a value
|
||||
*/
|
||||
export function allow(value: any, ...values: any[]): Schema;
|
||||
export function allow(values: any[]): Schema;
|
||||
|
||||
|
||||
+53
-60
@@ -2,50 +2,45 @@ import Joi = require('joi');
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var x: any = null;
|
||||
var value: any = null;
|
||||
var num: number = 0;
|
||||
var str: string = '';
|
||||
var bool: boolean = false;
|
||||
var exp: RegExp = null;
|
||||
var obj: object = null;
|
||||
var date: Date = null;
|
||||
var err: Error = null;
|
||||
var func: Function = null;
|
||||
let x: any = null;
|
||||
declare const value: any;
|
||||
let num = 0;
|
||||
let str = '';
|
||||
declare const bool: boolean;
|
||||
declare const exp: RegExp;
|
||||
declare const obj: object;
|
||||
declare const date: Date;
|
||||
declare const err: Error;
|
||||
declare const func: Function;
|
||||
|
||||
var anyArr: any[] = [];
|
||||
var numArr: number[] = [];
|
||||
var strArr: string[] = [];
|
||||
var boolArr: boolean[] = [];
|
||||
var expArr: RegExp[] = [];
|
||||
var objArr: object[] = [];
|
||||
var errArr: Error[] = [];
|
||||
var funcArr: Function[] = [];
|
||||
declare const numArr: number[];
|
||||
declare const strArr: string[];
|
||||
declare const expArr: RegExp[];
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schema: Joi.Schema = null;
|
||||
var schemaLike: Joi.SchemaLike = null;
|
||||
let schema: Joi.Schema = null;
|
||||
declare const schemaLike: Joi.SchemaLike;
|
||||
|
||||
var anySchema: Joi.AnySchema = null;
|
||||
var numSchema: Joi.NumberSchema = null;
|
||||
var strSchema: Joi.StringSchema = null;
|
||||
var arrSchema: Joi.ArraySchema = null;
|
||||
var boolSchema: Joi.BooleanSchema = null;
|
||||
var binSchema: Joi.BinarySchema = null;
|
||||
var dateSchema: Joi.DateSchema = null;
|
||||
var funcSchema: Joi.FunctionSchema = null;
|
||||
var objSchema: Joi.ObjectSchema = null;
|
||||
var altSchema: Joi.AlternativesSchema = null;
|
||||
let anySchema: Joi.AnySchema = null;
|
||||
let numSchema: Joi.NumberSchema = null;
|
||||
let strSchema: Joi.StringSchema = null;
|
||||
let arrSchema: Joi.ArraySchema = null;
|
||||
let boolSchema: Joi.BooleanSchema = null;
|
||||
let binSchema: Joi.BinarySchema = null;
|
||||
let dateSchema: Joi.DateSchema = null;
|
||||
let funcSchema: Joi.FunctionSchema = null;
|
||||
let objSchema: Joi.ObjectSchema = null;
|
||||
let altSchema: Joi.AlternativesSchema = null;
|
||||
|
||||
var schemaArr: Joi.Schema[] = [];
|
||||
declare const schemaArr: Joi.Schema[];
|
||||
|
||||
var ref: Joi.Reference = null;
|
||||
var description: Joi.Description = null;
|
||||
let ref: Joi.Reference = null;
|
||||
let description: Joi.Description = null;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validOpts: Joi.ValidationOptions = null;
|
||||
let validOpts: Joi.ValidationOptions = null;
|
||||
|
||||
validOpts = { abortEarly: bool };
|
||||
validOpts = { convert: bool };
|
||||
@@ -77,7 +72,7 @@ validOpts = {
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var renOpts: Joi.RenameOptions = null;
|
||||
let renOpts: Joi.RenameOptions;
|
||||
|
||||
renOpts = { alias: bool };
|
||||
renOpts = { multiple: bool };
|
||||
@@ -86,7 +81,7 @@ renOpts = { ignoreUndefined: bool };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var emailOpts: Joi.EmailOptions = null;
|
||||
let emailOpts: Joi.EmailOptions;
|
||||
|
||||
emailOpts = { errorLevel: num };
|
||||
emailOpts = { errorLevel: bool };
|
||||
@@ -96,7 +91,7 @@ emailOpts = { minDomainAtoms: num };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var ipOpts: Joi.IpOptions = null;
|
||||
let ipOpts: Joi.IpOptions;
|
||||
|
||||
ipOpts = { version: str };
|
||||
ipOpts = { version: strArr };
|
||||
@@ -104,7 +99,7 @@ ipOpts = { cidr: str };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var uriOpts: Joi.UriOptions = null;
|
||||
let uriOpts: Joi.UriOptions;
|
||||
|
||||
uriOpts = { scheme: str };
|
||||
uriOpts = { scheme: exp };
|
||||
@@ -113,7 +108,7 @@ uriOpts = { scheme: expArr };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var whenOpts: Joi.WhenOptions = null;
|
||||
let whenOpts: Joi.WhenOptions;
|
||||
|
||||
whenOpts = { is: x };
|
||||
whenOpts = { is: schema, then: schema };
|
||||
@@ -122,7 +117,7 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var whenSchemaOpts: Joi.WhenSchemaOptions = null;
|
||||
let whenSchemaOpts: Joi.WhenSchemaOptions;
|
||||
|
||||
whenSchemaOpts = { then: schema };
|
||||
whenSchemaOpts = { otherwise: schema };
|
||||
@@ -130,16 +125,16 @@ whenSchemaOpts = { then: schemaLike, otherwise: schemaLike };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var refOpts: Joi.ReferenceOptions = null;
|
||||
let refOpts: Joi.ReferenceOptions;
|
||||
|
||||
refOpts = { separator: str };
|
||||
refOpts = { contextPrefix: str };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validErr: Joi.ValidationError = null;
|
||||
var validErrItem: Joi.ValidationErrorItem;
|
||||
var validErrFunc: Joi.ValidationErrorFunction;
|
||||
declare const validErr: Joi.ValidationError;
|
||||
let validErrItem: Joi.ValidationErrorItem;
|
||||
let validErrFunc: Joi.ValidationErrorFunction;
|
||||
|
||||
validErrItem = {
|
||||
message: str,
|
||||
@@ -184,7 +179,7 @@ anySchema = objSchema;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schemaMap: Joi.SchemaMap = null;
|
||||
let schemaMap: Joi.SchemaMap;
|
||||
|
||||
schemaMap = {
|
||||
a: numSchema,
|
||||
@@ -216,13 +211,13 @@ schemaMap = {
|
||||
{ c1: true },
|
||||
{ c2: null }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
anySchema = Joi.any();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
anySchema = anySchema.allow(x);
|
||||
anySchema = anySchema.allow(x, x);
|
||||
anySchema = anySchema.allow([x, x, x]);
|
||||
@@ -304,7 +299,6 @@ arrSchema = arrSchema.unique();
|
||||
arrSchema = arrSchema.unique((a, b) => a.test === b.test);
|
||||
arrSchema = arrSchema.unique('customer.id');
|
||||
|
||||
|
||||
arrSchema = arrSchema.items(numSchema);
|
||||
arrSchema = arrSchema.items(numSchema, strSchema, schemaLike);
|
||||
arrSchema = arrSchema.items([numSchema, strSchema, schemaLike]);
|
||||
@@ -314,7 +308,7 @@ arrSchema = arrSchema.items([schemaMap, schemaMap, schemaLike]);
|
||||
|
||||
// - - - - - - - -
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
// use search & replace from any
|
||||
arrSchema = arrSchema.allow(x);
|
||||
arrSchema = arrSchema.allow(x, x);
|
||||
@@ -368,7 +362,7 @@ namespace common_copy_paste {
|
||||
boolSchema = Joi.bool();
|
||||
boolSchema = Joi.boolean();
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
boolSchema = boolSchema.allow(x);
|
||||
boolSchema = boolSchema.allow(x, x);
|
||||
boolSchema = boolSchema.allow([x, x, x]);
|
||||
@@ -443,7 +437,7 @@ binSchema = binSchema.min(num);
|
||||
binSchema = binSchema.max(num);
|
||||
binSchema = binSchema.length(num);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
binSchema = binSchema.allow(x);
|
||||
binSchema = binSchema.allow(x, x);
|
||||
binSchema = binSchema.allow([x, x, x]);
|
||||
@@ -516,7 +510,7 @@ dateSchema = dateSchema.timestamp();
|
||||
dateSchema = dateSchema.timestamp('javascript');
|
||||
dateSchema = dateSchema.timestamp('unix');
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
dateSchema = dateSchema.allow(x);
|
||||
dateSchema = dateSchema.allow(x, x);
|
||||
dateSchema = dateSchema.allow([x, x, x]);
|
||||
@@ -591,7 +585,7 @@ numSchema = numSchema.multiple(num);
|
||||
numSchema = numSchema.positive();
|
||||
numSchema = numSchema.negative();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
numSchema = numSchema.allow(x);
|
||||
numSchema = numSchema.allow(x, x);
|
||||
numSchema = numSchema.allow([x, x, x]);
|
||||
@@ -702,7 +696,7 @@ objSchema = objSchema.optionalKeys(str);
|
||||
objSchema = objSchema.optionalKeys(str, str);
|
||||
objSchema = objSchema.optionalKeys(strArr);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
objSchema = objSchema.allow(x);
|
||||
objSchema = objSchema.allow(x, x);
|
||||
objSchema = objSchema.allow([x, x, x]);
|
||||
@@ -781,7 +775,7 @@ strSchema = strSchema.ip(ipOpts);
|
||||
strSchema = strSchema.uri();
|
||||
strSchema = strSchema.uri(uriOpts);
|
||||
strSchema = strSchema.guid();
|
||||
strSchema = strSchema.guid({ version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5'] } as Joi.GuidOptions);
|
||||
strSchema = strSchema.guid({ version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5'] });
|
||||
strSchema = strSchema.guid({ version: 'uuidv4' });
|
||||
strSchema = strSchema.hex();
|
||||
strSchema = strSchema.hostname();
|
||||
@@ -794,7 +788,7 @@ strSchema = strSchema.truncate(false);
|
||||
strSchema = strSchema.normalize();
|
||||
strSchema = strSchema.normalize('NFKC');
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
strSchema = strSchema.allow(x);
|
||||
strSchema = strSchema.allow(x, x);
|
||||
strSchema = strSchema.allow([x, x, x]);
|
||||
@@ -860,11 +854,11 @@ schema = Joi.alt(schema, anySchema, boolSchema);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
schema = Joi.lazy(() => schema)
|
||||
schema = Joi.lazy(() => schema);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
namespace validate_tests {
|
||||
{ // validate tests
|
||||
{
|
||||
Joi.validate(value, obj);
|
||||
Joi.validate(value, schema);
|
||||
@@ -894,7 +888,7 @@ namespace validate_tests {
|
||||
|
||||
{
|
||||
let value = { username: 'example', password: 'example' };
|
||||
let schema = Joi.object().keys({
|
||||
const schema = Joi.object().keys({
|
||||
username: Joi.string().max(255).required(),
|
||||
password: Joi.string().regex(/^[a-zA-Z0-9]{3,255}$/).required(),
|
||||
});
|
||||
@@ -920,7 +914,6 @@ namespace validate_tests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
schema = Joi.compile(obj);
|
||||
|
||||
@@ -1,79 +1,12 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
// All are TODOs
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+751
-756
File diff suppressed because it is too large
Load Diff
+44
-51
@@ -2,48 +2,42 @@ import Joi = require('joi');
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var x: any = null;
|
||||
var value: any = null;
|
||||
var num: number = 0;
|
||||
var str: string = '';
|
||||
var bool: boolean = false;
|
||||
var exp: RegExp = null;
|
||||
var obj: Object = null;
|
||||
var date: Date = null;
|
||||
var err: Error = null;
|
||||
var func: Function = null;
|
||||
let x: any = null;
|
||||
declare const value: any;
|
||||
let num = 0;
|
||||
let str = '';
|
||||
declare const bool: boolean;
|
||||
declare const exp: RegExp;
|
||||
declare const obj: Object;
|
||||
declare const date: Date;
|
||||
declare const err: Error;
|
||||
declare const func: Function;
|
||||
|
||||
var anyArr: any[] = [];
|
||||
var numArr: number[] = [];
|
||||
var strArr: string[] = [];
|
||||
var boolArr: boolean[] = [];
|
||||
var expArr: RegExp[] = [];
|
||||
var objArr: Object[] = [];
|
||||
var errArr: Error[] = [];
|
||||
var funcArr: Function[] = [];
|
||||
declare const strArr: string[];
|
||||
declare const expArr: RegExp[];
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schema: Joi.Schema = null;
|
||||
let schema: Joi.Schema = null;
|
||||
|
||||
var anySchema: Joi.AnySchema<Joi.Schema> = null;
|
||||
var numSchema: Joi.NumberSchema = null;
|
||||
var strSchema: Joi.StringSchema = null;
|
||||
var arrSchema: Joi.ArraySchema = null;
|
||||
var boolSchema: Joi.BooleanSchema = null;
|
||||
var binSchema: Joi.BinarySchema = null;
|
||||
var dateSchema: Joi.DateSchema = null;
|
||||
var funcSchema: Joi.FunctionSchema = null;
|
||||
var objSchema: Joi.ObjectSchema = null;
|
||||
var altSchema: Joi.AlternativesSchema = null;
|
||||
let anySchema: Joi.AnySchema<Joi.Schema> = null;
|
||||
let numSchema: Joi.NumberSchema = null;
|
||||
let strSchema: Joi.StringSchema = null;
|
||||
let arrSchema: Joi.ArraySchema = null;
|
||||
let boolSchema: Joi.BooleanSchema = null;
|
||||
let binSchema: Joi.BinarySchema = null;
|
||||
let dateSchema: Joi.DateSchema = null;
|
||||
let funcSchema: Joi.FunctionSchema = null;
|
||||
let objSchema: Joi.ObjectSchema = null;
|
||||
let altSchema: Joi.AlternativesSchema = null;
|
||||
|
||||
var schemaArr: Joi.Schema[] = [];
|
||||
declare const schemaArr: Joi.Schema[];
|
||||
|
||||
var ref: Joi.Reference = null;
|
||||
let ref: Joi.Reference = null;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validOpts: Joi.ValidationOptions = null;
|
||||
let validOpts: Joi.ValidationOptions = null;
|
||||
|
||||
validOpts = {abortEarly: bool};
|
||||
validOpts = {convert: bool};
|
||||
@@ -56,7 +50,7 @@ validOpts = {context: obj};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var renOpts: Joi.RenameOptions = null;
|
||||
let renOpts: Joi.RenameOptions = null;
|
||||
|
||||
renOpts = {alias: bool};
|
||||
renOpts = {multiple: bool};
|
||||
@@ -65,7 +59,7 @@ renOpts = {ignoreUndefined: bool};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var emailOpts: Joi.EmailOptions = null;
|
||||
let emailOpts: Joi.EmailOptions = null;
|
||||
|
||||
emailOpts = {errorLevel: num};
|
||||
emailOpts = {errorLevel: bool};
|
||||
@@ -75,7 +69,7 @@ emailOpts = {minDomainAtoms: num};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var ipOpts: Joi.IpOptions = null;
|
||||
let ipOpts: Joi.IpOptions = null;
|
||||
|
||||
ipOpts = {version: str};
|
||||
ipOpts = {version: strArr};
|
||||
@@ -83,7 +77,7 @@ ipOpts = {cidr: str};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var uriOpts: Joi.UriOptions = null;
|
||||
let uriOpts: Joi.UriOptions = null;
|
||||
|
||||
uriOpts = {scheme: str};
|
||||
uriOpts = {scheme: exp};
|
||||
@@ -92,7 +86,7 @@ uriOpts = {scheme: expArr};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var whenOpts: Joi.WhenOptions<any> = null;
|
||||
let whenOpts: Joi.WhenOptions<any> = null;
|
||||
|
||||
whenOpts = {is: x};
|
||||
whenOpts = {is: schema, then: schema};
|
||||
@@ -100,17 +94,17 @@ whenOpts = {is: schema, otherwise: schema};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var refOpts: Joi.ReferenceOptions = null;
|
||||
let refOpts: Joi.ReferenceOptions = null;
|
||||
|
||||
refOpts = {separator: str};
|
||||
refOpts = {contextPrefix: str};
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validErr: Joi.ValidationError = null;
|
||||
var validErrItem: Joi.ValidationErrorItem;
|
||||
declare const validErr: Joi.ValidationError;
|
||||
let validErrItem: Joi.ValidationErrorItem;
|
||||
|
||||
validErrItem= {
|
||||
validErrItem = {
|
||||
message: str,
|
||||
type: str,
|
||||
path: str
|
||||
@@ -149,7 +143,7 @@ anySchema = objSchema;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schemaMap: Joi.SchemaMap = null;
|
||||
let schemaMap: Joi.SchemaMap = null;
|
||||
|
||||
schemaMap = {
|
||||
a: numSchema,
|
||||
@@ -160,7 +154,7 @@ schemaMap = {
|
||||
|
||||
anySchema = Joi.any();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
anySchema = anySchema.allow(x);
|
||||
anySchema = anySchema.allow(x, x);
|
||||
anySchema = anySchema.allow([x, x, x]);
|
||||
@@ -235,10 +229,9 @@ arrSchema = arrSchema.items(numSchema);
|
||||
arrSchema = arrSchema.items(numSchema, strSchema);
|
||||
arrSchema = arrSchema.items([numSchema, strSchema]);
|
||||
|
||||
|
||||
// - - - - - - - -
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
// use search & replace from any
|
||||
arrSchema = arrSchema.allow(x);
|
||||
arrSchema = arrSchema.allow(x, x);
|
||||
@@ -291,7 +284,7 @@ namespace common_copy_paste {
|
||||
boolSchema = Joi.bool();
|
||||
boolSchema = Joi.boolean();
|
||||
|
||||
namespace common_copy_paste {
|
||||
{ // common copy paste
|
||||
boolSchema = boolSchema.allow(x);
|
||||
boolSchema = boolSchema.allow(x, x);
|
||||
boolSchema = boolSchema.allow([x, x, x]);
|
||||
@@ -347,7 +340,7 @@ binSchema = binSchema.min(num);
|
||||
binSchema = binSchema.max(num);
|
||||
binSchema = binSchema.length(num);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
binSchema = binSchema.allow(x);
|
||||
binSchema = binSchema.allow(x, x);
|
||||
binSchema = binSchema.allow([x, x, x]);
|
||||
@@ -415,7 +408,7 @@ dateSchema = dateSchema.format(strArr);
|
||||
|
||||
dateSchema = dateSchema.iso();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
dateSchema = dateSchema.allow(x);
|
||||
dateSchema = dateSchema.allow(x, x);
|
||||
dateSchema = dateSchema.allow([x, x, x]);
|
||||
@@ -484,7 +477,7 @@ numSchema = numSchema.multiple(num);
|
||||
numSchema = numSchema.positive();
|
||||
numSchema = numSchema.negative();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
numSchema = numSchema.allow(x);
|
||||
numSchema = numSchema.allow(x, x);
|
||||
numSchema = numSchema.allow([x, x, x]);
|
||||
@@ -593,7 +586,7 @@ objSchema = objSchema.optionalKeys(str);
|
||||
objSchema = objSchema.optionalKeys(str, str);
|
||||
objSchema = objSchema.optionalKeys(strArr);
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
objSchema = objSchema.allow(x);
|
||||
objSchema = objSchema.allow(x, x);
|
||||
objSchema = objSchema.allow([x, x, x]);
|
||||
@@ -678,7 +671,7 @@ strSchema = strSchema.lowercase();
|
||||
strSchema = strSchema.uppercase();
|
||||
strSchema = strSchema.trim();
|
||||
|
||||
namespace common {
|
||||
{ // common
|
||||
strSchema = strSchema.allow(x);
|
||||
strSchema = strSchema.allow(x, x);
|
||||
strSchema = strSchema.allow([x, x, x]);
|
||||
|
||||
@@ -1,79 +1,12 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
// All are TODOs
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+15
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for JSON5
|
||||
// Project: http://json5.org/
|
||||
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
|
||||
// Kacper Wiszczuk <https://github.com/Esemesek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -40,5 +41,18 @@ Comments
|
||||
|
||||
Both inline (single-line) and block (multi-line) comments are allowed.
|
||||
*/
|
||||
declare var json5: JSON;
|
||||
|
||||
type JSONReplacer = (key: string, value: any) => any | (number | string)[] | null;
|
||||
|
||||
interface JSON5 {
|
||||
// Old JSON methods
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
|
||||
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
||||
|
||||
// New JSON5 stringify function
|
||||
stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string;
|
||||
}
|
||||
|
||||
declare var json5: JSON5;
|
||||
export = json5;
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
|
||||
import JSON5 = require('json5');
|
||||
|
||||
var obj = JSON5.parse("{ key:'val', 'key2':[0,1,2,] } //comment ");
|
||||
var str = JSON5.stringify(obj, null, "\t");
|
||||
console.log(str);
|
||||
const STR = "{ key:'val', 'key2':[0,1,2,] } //comment ";
|
||||
const OBJ = { key: 'value', key2: [0, 1, 2] };
|
||||
|
||||
function reviverFunction(key: any, value: any): any {
|
||||
return { [key]: value };
|
||||
}
|
||||
|
||||
function replacerFunction(key: string, value: any) {
|
||||
return { [key]: value };
|
||||
}
|
||||
|
||||
const str1: string = JSON5.stringify(OBJ);
|
||||
const str2: string = JSON5.stringify(OBJ, null, 4);
|
||||
const str3: string = JSON5.stringify(OBJ, undefined, '2');
|
||||
const str4: string = JSON5.stringify(OBJ, replacerFunction, 2);
|
||||
|
||||
JSON.parse(STR);
|
||||
JSON.parse(STR, reviverFunction);
|
||||
|
||||
Vendored
+190
-52
@@ -1163,6 +1163,8 @@ declare namespace Office {
|
||||
*
|
||||
* @param options - Optional. Accepts an AuthOptions object to define sign-on behaviors.
|
||||
* @param callback - Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token.
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void;
|
||||
|
||||
@@ -1881,6 +1883,14 @@ declare namespace Office {
|
||||
* </table>
|
||||
*/
|
||||
ActiveViewChanged,
|
||||
/**
|
||||
* Triggers when the appointment date or time of the selected series was changed in Outlook.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
AppointmentTimeChanged,
|
||||
/**
|
||||
* Occurs when data within the binding is changed.
|
||||
* To add an event handler for the BindingDataChanged event of a binding, use the addHandlerAsync method of the Binding object.
|
||||
@@ -1973,6 +1983,14 @@ declare namespace Office {
|
||||
* Triggers when a customXmlPart node was replaced.
|
||||
*/
|
||||
NodeReplaced,
|
||||
/**
|
||||
* Triggers when the recipient list of the selected item was changed in Outlook.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
RecipientsChanged,
|
||||
/**
|
||||
* Triggers when the recurrence pattern of the selected series was changed in Outlook.
|
||||
*
|
||||
@@ -8729,7 +8747,7 @@ declare namespace Office {
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP"
|
||||
* (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
@@ -8764,7 +8782,7 @@ declare namespace Office {
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP"
|
||||
* (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
@@ -8789,7 +8807,7 @@ declare namespace Office {
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP"
|
||||
* (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
@@ -8813,7 +8831,7 @@ declare namespace Office {
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP"
|
||||
* (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
@@ -9186,6 +9204,37 @@ declare namespace Office {
|
||||
getAsync(callback?: (result: AsyncResult) => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the appointment organizer, even if an alias or a delegate was used to create the appointment.
|
||||
* This object provides a method to get the organizer value of an appointment in an Outlook add-in.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Compose</td></tr></table>
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
export interface Organizer {
|
||||
/**
|
||||
* Gets the organizer value of an appointment as an {@link Office.EmailAddressDetails} in the asyncResult.value property.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Compose</td></tr></table>
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object.
|
||||
*/
|
||||
getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The subclass of {@link Office.Item} dealing with appointments.
|
||||
*
|
||||
@@ -9310,6 +9359,22 @@ declare namespace Office {
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Appointment Organizer</td></tr></table>
|
||||
*/
|
||||
optionalAttendees: Recipients;
|
||||
/**
|
||||
* Gets the organizer for the specified meeting.
|
||||
*
|
||||
* The organizer property returns an {@link Office.Organizer | Organizer} object that provides a method to get the organizer value.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Appointment Organizer</td></tr></table>
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
organizer: Office.Organizer;
|
||||
/**
|
||||
* Gets or sets the recurrence pattern of an appointment.
|
||||
*
|
||||
@@ -9433,7 +9498,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult.
|
||||
* On success, the attachment identifier will be provided in the asyncResult.value property.
|
||||
* If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error.
|
||||
@@ -9479,7 +9544,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list.
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;
|
||||
/**
|
||||
@@ -9505,10 +9570,34 @@ declare namespace Office {
|
||||
* If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error.
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Adds a file to a message or appointment as an attachment.
|
||||
*
|
||||
* The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the AsyncResult.value object.
|
||||
*
|
||||
* You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Appointment Organizer</td></tr>
|
||||
*
|
||||
* <tr><td>Errors</td><td>AttachmentSizeExceeded - The attachment is larger than allowed.</td></tr><tr><td></td><td>FileTypeNotSupported - The attachment has an extension that is not allowed.</td></tr><tr><td></td><td>NumberOfAttachmentsExceeded - The message or appointment has too many attachments.</td></tr></table>
|
||||
*
|
||||
* @param base64File The base64 encoded content of an image or file to be added to an email or event.
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error.
|
||||
*/
|
||||
addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -9536,8 +9625,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -9733,7 +9822,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data.
|
||||
* To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -9760,7 +9849,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data.
|
||||
* To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -9912,8 +10001,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -9941,7 +10030,7 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -10433,7 +10522,7 @@ declare namespace Office {
|
||||
*/
|
||||
optionalAttendees: EmailAddressDetails[];
|
||||
/**
|
||||
* Gets the email address of the meeting organizer for a specified meeting. Read mode only.
|
||||
* Gets the email address of the meeting organizer for a specified meeting.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
*
|
||||
@@ -10541,8 +10630,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -10571,8 +10660,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -10926,8 +11015,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -10955,8 +11044,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -11109,7 +11198,7 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -11138,7 +11227,7 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -11187,8 +11276,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -11217,8 +11306,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -11289,7 +11378,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of
|
||||
* type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property.
|
||||
@@ -11337,7 +11426,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* attachment list.
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;
|
||||
@@ -11366,6 +11455,31 @@ declare namespace Office {
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;
|
||||
|
||||
/**
|
||||
* Adds a file to a message or appointment as an attachment.
|
||||
*
|
||||
* The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the AsyncResult.value object.
|
||||
*
|
||||
* You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Appointment Organizer</td></tr>
|
||||
*
|
||||
* <tr><td>Errors</td><td>AttachmentSizeExceeded - The attachment is larger than allowed.</td></tr><tr><td></td><td>FileTypeNotSupported - The attachment has an extension that is not allowed.</td></tr><tr><td></td><td>NumberOfAttachmentsExceeded - The message or appointment has too many attachments.</td></tr></table>
|
||||
*
|
||||
* @param base64File The base64 encoded content of an image or file to be added to an email or event.
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error.
|
||||
*/
|
||||
addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
|
||||
/**
|
||||
* Adds an Exchange item, such as a message, as an attachment to the message or appointment.
|
||||
*
|
||||
@@ -11546,7 +11660,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes
|
||||
* from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -11572,7 +11686,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data.
|
||||
* To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -12659,7 +12773,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the
|
||||
* attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of
|
||||
* type {@link Office.asyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property.
|
||||
@@ -12707,7 +12821,7 @@ declare namespace Office {
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list.
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;
|
||||
/**
|
||||
@@ -12734,10 +12848,34 @@ declare namespace Office {
|
||||
* the error.
|
||||
*/
|
||||
addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Adds a file to a message or appointment as an attachment.
|
||||
*
|
||||
* The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the AsyncResult.value object.
|
||||
*
|
||||
* You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
* @remarks
|
||||
* <table><tr><td>{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}</td><td>ReadWriteItem</td></tr>
|
||||
*
|
||||
* <tr><td>{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}</td><td>Appointment Organizer</td></tr>
|
||||
*
|
||||
* <tr><td>Errors</td><td>AttachmentSizeExceeded - The attachment is larger than allowed.</td></tr><tr><td></td><td>FileTypeNotSupported - The attachment has an extension that is not allowed.</td></tr><tr><td></td><td>NumberOfAttachmentsExceeded - The message or appointment has too many attachments.</td></tr></table>
|
||||
*
|
||||
* @param base64File The base64 encoded content of an image or file to be added to an email or event.
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error.
|
||||
*/
|
||||
addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -12765,8 +12903,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -12965,7 +13103,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data.
|
||||
* To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -12991,7 +13129,7 @@ declare namespace Office {
|
||||
* To access the selected data from the callback method, call asyncResult.value.data.
|
||||
* To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
* [Api set: Mailbox 1.2]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
@@ -13144,8 +13282,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -13173,8 +13311,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -13788,8 +13926,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -13818,8 +13956,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Adds an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -14177,8 +14315,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
@@ -14206,8 +14344,8 @@ declare namespace Office {
|
||||
/**
|
||||
* Removes an event handler for a supported event.
|
||||
*
|
||||
* Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the
|
||||
* recurrence pattern of a series.
|
||||
* Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and
|
||||
* `Office.EventType.RecurrencePatternChanged`.
|
||||
*
|
||||
* [Api set: Mailbox Preview]
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for ora v0.3.0
|
||||
// Type definitions for ora 0.3
|
||||
// Project: https://github.com/sindresorhus/ora
|
||||
// Definitions by: Basarat Ali Syed <https://github.com/basarat/>, Christian Rackerseder <https://github.com/screendriver>
|
||||
// Definitions by: Basarat Ali Syed <https://github.com/basarat>, Christian Rackerseder <https://github.com/screendriver>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -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
+11
-7
@@ -1,6 +1,6 @@
|
||||
// Type definitions for react-credit-cards 0.7
|
||||
// Project: https://github.com/amarofashion/react-credit-cards
|
||||
// Definitions by: Vytautas Strimaitis <https://github.com/vstrimaitis>
|
||||
// Definitions by: Vytautas Strimaitis <https://github.com/vstrimaitis>, Ole Frank <https://github.com/olefrank>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -8,24 +8,28 @@ import * as React from "react";
|
||||
|
||||
export interface CallbackArgument {
|
||||
isValid: boolean;
|
||||
type: { issuer: string; maxLength: number; };
|
||||
type: { issuer: string; maxLength: number };
|
||||
}
|
||||
|
||||
export type Focused = "name" | "number" | "expiry" | "cvc";
|
||||
|
||||
export interface ReactCreditCardProps {
|
||||
acceptedCards?: ReadonlyArray<string>;
|
||||
callback?: (type: CallbackArgument, isValid: boolean) => void;
|
||||
cvc: string | number;
|
||||
expiry: string | number;
|
||||
focused?: "name" | "number" | "expiry" | "cvc";
|
||||
focused?: Focused;
|
||||
issuer?: string;
|
||||
locale?: { valid: string; };
|
||||
locale?: { valid: string };
|
||||
name: string;
|
||||
number: string | number;
|
||||
placeholders?: { name: string; };
|
||||
placeholders?: { name: string };
|
||||
preview?: boolean;
|
||||
}
|
||||
|
||||
declare class ReactCreditCard extends React.Component<ReactCreditCardProps, never> {
|
||||
}
|
||||
declare class ReactCreditCard extends React.Component<
|
||||
ReactCreditCardProps,
|
||||
never
|
||||
> {}
|
||||
|
||||
export default ReactCreditCard;
|
||||
|
||||
Vendored
+2
-10
@@ -1919,7 +1919,7 @@ type AccessibilityTrait =
|
||||
* @see https://facebook.github.io/react-native/docs/view.html#props
|
||||
*/
|
||||
export interface ViewProps
|
||||
extends ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, AccessibilityProps, ViewStyle {
|
||||
extends ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, AccessibilityProps {
|
||||
/**
|
||||
* This defines how far a touch event can start away from the view.
|
||||
* Typical interface guidelines recommend touch targets that are at least
|
||||
@@ -3605,7 +3605,7 @@ export interface ImageResolvedAssetSource {
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/image.html
|
||||
*/
|
||||
export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps, ImageStyle {
|
||||
export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps {
|
||||
/**
|
||||
* onLayout function
|
||||
*
|
||||
@@ -3720,14 +3720,6 @@ export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, Access
|
||||
* A static image to display while downloading the final image off the network.
|
||||
*/
|
||||
defaultSource?: ImageURISource | number;
|
||||
|
||||
/**
|
||||
* Currently broken
|
||||
* @see https://github.com/facebook/react-native/pull/19281
|
||||
*/
|
||||
width?: never;
|
||||
height?: never;
|
||||
tintColor?: never;
|
||||
}
|
||||
|
||||
export interface ImageProps extends ImagePropsBase {
|
||||
|
||||
@@ -686,31 +686,6 @@ export class ImageBackgroundProps extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
class StylePropsTest extends React.PureComponent {
|
||||
render() {
|
||||
const uri = 'https://seeklogo.com/images/T/typescript-logo-B29A3F462D-seeklogo.com.png'
|
||||
|
||||
return (
|
||||
<View backgroundColor="lightgray" flex={1} overflow="scroll">
|
||||
<Image
|
||||
borderRadius={100}
|
||||
// height={200}
|
||||
margin={20}
|
||||
overflow="visible" // ps: must fail if "scroll"
|
||||
source={{ uri }}
|
||||
style={{ width: 200, height: 200, tintColor: 'green', flexWrap: 'wrap-reverse' }}
|
||||
// tintColor="green"
|
||||
// width={200}
|
||||
/>
|
||||
|
||||
<Text style={{ /* iOs only */ textTransform: 'capitalize' }}>
|
||||
Text
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const listViewDataSourceTest = new ListView.DataSource({rowHasChanged: () => true})
|
||||
|
||||
class AccessibilityTest extends React.Component {
|
||||
|
||||
Vendored
+42
-17
@@ -1,4 +1,4 @@
|
||||
// Type definitions for sparqljs 1.5
|
||||
// Type definitions for sparqljs 2.1
|
||||
// Project: https://github.com/RubenVerborgh/SPARQL.js
|
||||
// Definitions by: Alexey Morozov <https://github.com/AlexeyMz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -8,7 +8,6 @@ export const Parser: {
|
||||
new (
|
||||
prefixes?: { [prefix: string]: string },
|
||||
baseIRI?: string,
|
||||
options?: ParserOptions,
|
||||
): SparqlParser;
|
||||
};
|
||||
|
||||
@@ -16,11 +15,6 @@ export const Generator: {
|
||||
new (options?: GeneratorOptions): SparqlGenerator;
|
||||
};
|
||||
|
||||
export interface ParserOptions {
|
||||
/** @default true */
|
||||
collapseGroups?: boolean;
|
||||
}
|
||||
|
||||
export interface GeneratorOptions {
|
||||
allPrefixes?: boolean;
|
||||
}
|
||||
@@ -94,6 +88,7 @@ export type UpdateOperation = InsertDeleteOperation | ManagementOperation;
|
||||
|
||||
export interface InsertDeleteOperation {
|
||||
updateType: 'insert' | 'delete' | 'deletewhere' | 'insertdelete';
|
||||
graph?: string;
|
||||
insert?: Quads[];
|
||||
delete?: Quads[];
|
||||
where?: Pattern[];
|
||||
@@ -101,17 +96,47 @@ export interface InsertDeleteOperation {
|
||||
|
||||
export type Quads = BgpPattern | GraphQuads;
|
||||
|
||||
export interface ManagementOperation {
|
||||
type: 'load' | 'copy' | 'move' | 'add';
|
||||
export type ManagementOperation =
|
||||
| CopyMoveAddOperation
|
||||
| LoadOperation
|
||||
| CreateOperation
|
||||
| ClearDropOperation;
|
||||
|
||||
export interface CopyMoveAddOperation {
|
||||
type: 'copy' | 'move' | 'add';
|
||||
silent: boolean;
|
||||
source: string | {
|
||||
type: 'graph';
|
||||
default: boolean;
|
||||
};
|
||||
destination?: string | {
|
||||
type: 'graph';
|
||||
name: string;
|
||||
};
|
||||
source: GraphOrDefault;
|
||||
destination: GraphOrDefault;
|
||||
}
|
||||
|
||||
export interface LoadOperation {
|
||||
type: 'load';
|
||||
silent: boolean;
|
||||
source: string;
|
||||
destination: string | false;
|
||||
}
|
||||
|
||||
export interface CreateOperation {
|
||||
type: 'create';
|
||||
silent: boolean;
|
||||
graph: string;
|
||||
}
|
||||
|
||||
export interface ClearDropOperation {
|
||||
type: 'clear' | 'drop';
|
||||
silent: boolean;
|
||||
graph: GraphReference;
|
||||
}
|
||||
|
||||
export interface GraphOrDefault {
|
||||
type: 'graph';
|
||||
name?: string;
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
export interface GraphReference extends GraphOrDefault {
|
||||
named?: boolean;
|
||||
all?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,8 +26,7 @@ function officialExamples() {
|
||||
function advancedOptions() {
|
||||
const parser = new SparqlJs.Parser(
|
||||
{rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'},
|
||||
'http://example.com',
|
||||
{collapseGroups: true}
|
||||
'http://example.com'
|
||||
);
|
||||
const generator = new SparqlJs.Generator({allPrefixes: false});
|
||||
}
|
||||
@@ -122,3 +121,49 @@ function basicQueries() {
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Update query structure
|
||||
*/
|
||||
function updateQueries() {
|
||||
const bgp: SparqlJs.BgpPattern = {
|
||||
type: 'bgp',
|
||||
triples: [],
|
||||
};
|
||||
|
||||
const update: SparqlJs.Update = {
|
||||
type: 'update',
|
||||
prefixes: {
|
||||
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
|
||||
},
|
||||
updates: [
|
||||
{
|
||||
updateType: 'insertdelete',
|
||||
graph: 'http://example.com/foo',
|
||||
insert: [bgp],
|
||||
delete: [bgp],
|
||||
where: [],
|
||||
},
|
||||
{
|
||||
type: 'copy',
|
||||
silent: true,
|
||||
source: {
|
||||
type: 'graph',
|
||||
name: 'http://example.com/foo',
|
||||
},
|
||||
destination: {
|
||||
type: 'graph',
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'clear',
|
||||
silent: false,
|
||||
graph: {
|
||||
type: 'graph',
|
||||
all: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for websequencediagrams 0.1
|
||||
// Project: https://github.com/hildjj/node-websequencediagrams
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export type OutputType = 'png' | 'svg' | 'pdf';
|
||||
export type Style = 'default' | 'earth' | 'modern-blue' | 'mscgen' | 'omegapple' | 'qsd' | 'rose' | 'roundgreen' | 'napkin' | 'magazine' | 'vs2010' | 'patent';
|
||||
export type diagramCallback = (error: Error | null, buffer?: Buffer, mimeType?: string) => void;
|
||||
export type diagramUrlCallback = (error: Error | null, url?: string) => void;
|
||||
|
||||
export const root: string;
|
||||
export const styles: Style[];
|
||||
|
||||
export function diagram(description: string | Buffer, style: Style | null, format: OutputType | null, callback: diagramCallback): void;
|
||||
export function diagram_url(description: string | Buffer, style: Style | null, format: OutputType | null, callback: diagramUrlCallback): void;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"websequencediagrams-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,18 @@
|
||||
import * as wsd from 'websequencediagrams';
|
||||
|
||||
wsd.diagram('Alice->Bob: message', 'modern-blue', 'png', (error, buffer, mimeType) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('Received MIME type:', mimeType);
|
||||
console.log('Received Buffer:', buffer);
|
||||
}
|
||||
});
|
||||
|
||||
wsd.diagram_url('Alice->Bob: message', 'modern-blue', 'png', (error, url) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('Received URL:', url);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user