mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
stream/master'
This commit is contained in:
@@ -786,6 +786,12 @@
|
||||
"sourceRepoURL": "https://github.com/manuelbieh/Geolib",
|
||||
"asOfVersion": "2.0.23"
|
||||
},
|
||||
{
|
||||
"libraryName": "get-port",
|
||||
"typingsPackageName": "get-port",
|
||||
"sourceRepoURL": "https://github.com/sindresorhus/get-port",
|
||||
"asOfVersion": "4.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "get-stream",
|
||||
"typingsPackageName": "get-stream",
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import * as Airtable from 'airtable';
|
||||
|
||||
interface Row extends Airtable.FieldSet {
|
||||
field1: string;
|
||||
attachments: Airtable.Attachment[];
|
||||
}
|
||||
|
||||
const airtable = new Airtable();
|
||||
|
||||
const base = airtable.base('app id');
|
||||
|
||||
const table = base('table name') as Airtable.Table<Row>;
|
||||
|
||||
async () => {
|
||||
const query = table.select();
|
||||
{
|
||||
const rows = await query.all();
|
||||
for (const row of rows) {
|
||||
row.id; // $ExpectType string
|
||||
row.fields.field1; // $ExpectType string
|
||||
for (const attachment of row.fields.attachments) {
|
||||
attachment.id; // $ExpectType string
|
||||
attachment.filename; // $ExpectType string
|
||||
attachment.size; // $ExpectType number
|
||||
attachment.type; // $ExpectType string
|
||||
attachment.url; // $ExpectType string
|
||||
if (attachment.thumbnails) {
|
||||
attachment.thumbnails.full.height; // $ExpectType number
|
||||
attachment.thumbnails.full.width; // $ExpectType number
|
||||
attachment.thumbnails.full.url; // $ExpectType string
|
||||
|
||||
attachment.thumbnails.large.height; // $ExpectType number
|
||||
attachment.thumbnails.large.width; // $ExpectType number
|
||||
attachment.thumbnails.large.url; // $ExpectType string
|
||||
|
||||
attachment.thumbnails.small.height; // $ExpectType number
|
||||
attachment.thumbnails.small.width; // $ExpectType number
|
||||
attachment.thumbnails.small.url; // $ExpectType string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
// Type definitions for airtable 0.5
|
||||
// Project: https://github.com/airtable/airtable.js
|
||||
// Definitions by: Brandon Valosek <https://github.com/bvalosek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = Airtable;
|
||||
|
||||
declare global {
|
||||
class Airtable {
|
||||
base(appId: string): Airtable.Base;
|
||||
}
|
||||
|
||||
namespace Airtable {
|
||||
interface FieldSet {
|
||||
[ key: string ]: undefined | string | ReadonlyArray<Attachment>;
|
||||
}
|
||||
|
||||
interface Base {
|
||||
(tableName: string): Table<{}>;
|
||||
}
|
||||
|
||||
interface Table<TFields extends FieldSet> {
|
||||
select(opt?: SelectOptions): Query<TFields>;
|
||||
}
|
||||
|
||||
interface SelectOptions {
|
||||
view?: string;
|
||||
}
|
||||
|
||||
interface Query<TFields extends object> {
|
||||
all(): Promise<Response<TFields>>;
|
||||
firstPage(): Promise<Response<TFields>>;
|
||||
}
|
||||
|
||||
type Response<TFields> = ReadonlyArray<Row<TFields>>;
|
||||
|
||||
interface Row<TFields> {
|
||||
id: string;
|
||||
fields: TFields;
|
||||
}
|
||||
|
||||
interface Attachment {
|
||||
id: string;
|
||||
url: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
type: string;
|
||||
thumbnails?: {
|
||||
small: Thumbnail;
|
||||
large: Thumbnail;
|
||||
full: Thumbnail;
|
||||
};
|
||||
}
|
||||
|
||||
interface Thumbnail {
|
||||
url: string;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"get-port-tests.ts"
|
||||
"airtable-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
// Type definitions for align-text 1.0
|
||||
// Project: https://github.com/jonschlinkert/align-text
|
||||
// Definitions by: Claas Ahlrichs <https://github.com/claasahl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
interface TransformResult {
|
||||
/**
|
||||
* the amount of indentation to use. Default is 0 when an object is returned.
|
||||
*/
|
||||
indent: number;
|
||||
/**
|
||||
* the character to use for indentation. Default is '' (empty string) when an object is returned.
|
||||
*/
|
||||
character: string;
|
||||
/**
|
||||
* leading characters to use at the beginning of each line. '' (empty string) when an object is returned.
|
||||
*/
|
||||
prefix: string;
|
||||
}
|
||||
|
||||
interface Callback {
|
||||
/**
|
||||
* @param len the length of the "current" line
|
||||
* @param longest the length of the longest line
|
||||
* @param line the current line (string) being aligned
|
||||
* @param lines the array of all lines
|
||||
*/
|
||||
(len: number, longest: number, line: string, lines: string[]):
|
||||
| number
|
||||
| TransformResult;
|
||||
}
|
||||
|
||||
declare function align_text(text: string, fn: number | Callback): string;
|
||||
declare function align_text(text: string[], fn: number | Callback): string[];
|
||||
|
||||
export = align_text;
|
||||
@@ -0,0 +1,12 @@
|
||||
import align from "align-text";
|
||||
|
||||
function centerAlign(len: number, longest: number) {
|
||||
return {
|
||||
character: "\t",
|
||||
indent: Math.floor((longest - len) / 2),
|
||||
prefix: "~ "
|
||||
};
|
||||
}
|
||||
|
||||
const text = ["abc", "abc", "abc"];
|
||||
align(text, centerAlign);
|
||||
@@ -0,0 +1,8 @@
|
||||
import align from "align-text";
|
||||
|
||||
function centerAlign(len: number, longest: number) {
|
||||
return Math.floor((longest - len) / 2);
|
||||
}
|
||||
|
||||
const text = ["abc", "abc", "abc"];
|
||||
align(text, centerAlign);
|
||||
@@ -0,0 +1,6 @@
|
||||
import align from "align-text";
|
||||
|
||||
const text = ["abc", "abc", "abc"];
|
||||
align(text, 4);
|
||||
|
||||
align("abc", 2);
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/simple.ts",
|
||||
"test/center-simple.ts",
|
||||
"test/center-complex.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,435 @@
|
||||
declare const map: AMap.Map;
|
||||
declare const div: HTMLElement;
|
||||
declare const lnglat: AMap.LngLat;
|
||||
declare const lnglatTuple: [number, number];
|
||||
declare const bounds: AMap.Bounds;
|
||||
declare const polygon: AMap.Polygon;
|
||||
declare const lang: AMap.Lang;
|
||||
|
||||
// $ExpectType PlaceSearch
|
||||
const placeSearch = new AMap.PlaceSearch();
|
||||
// $ExpectType PlaceSearch
|
||||
new AMap.PlaceSearch({});
|
||||
// $ExpectType PlaceSearch
|
||||
new AMap.PlaceSearch({
|
||||
city: '深圳',
|
||||
citylimit: true,
|
||||
children: 1,
|
||||
type: '餐饮服务',
|
||||
lang: 'zh_cn',
|
||||
pageSize: 10,
|
||||
pageIndex: 10,
|
||||
extensions: 'all',
|
||||
map,
|
||||
panel: div,
|
||||
showCover: true,
|
||||
renderStyle: 'newpc',
|
||||
autoFitView: true
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.search('keyword', (status, result) => {
|
||||
const temp: 'error' | 'complete' | 'no_data' = status;
|
||||
// $ExpectType string | SearchResult
|
||||
result;
|
||||
if (typeof result !== 'string') {
|
||||
// $ExpectType string
|
||||
result.info;
|
||||
// $ExpectType PoiList
|
||||
result.poiList;
|
||||
// $ExpectType string[] | undefined
|
||||
result.keywordList;
|
||||
// $ExpectType CityInfo[] | undefined
|
||||
result.cityList;
|
||||
|
||||
const poiList = result.poiList;
|
||||
// $ExpectType number
|
||||
poiList.pageIndex;
|
||||
// $ExpectType number
|
||||
poiList.pageSize;
|
||||
// $ExpectType number
|
||||
poiList.count;
|
||||
|
||||
const poi = poiList.pois[0];
|
||||
// $ExpectType string
|
||||
poi.address;
|
||||
// $ExpectType number
|
||||
poi.distance;
|
||||
// $ExpectType string
|
||||
poi.id;
|
||||
// $ExpectType LngLat | null
|
||||
poi.location;
|
||||
// $ExpectType string
|
||||
poi.name;
|
||||
// $ExpectType string
|
||||
poi.shopinfo;
|
||||
// $ExpectType string
|
||||
poi.tel;
|
||||
// $ExpectType string
|
||||
poi.type;
|
||||
if ('website' in poi) {
|
||||
// $ExpectType string
|
||||
poi.adcode;
|
||||
// $ExpectType string
|
||||
poi.adname;
|
||||
// $ExpectType string
|
||||
poi.citycode;
|
||||
// $ExpectType string
|
||||
poi.cityname;
|
||||
// $ExpectType boolean
|
||||
poi.discount;
|
||||
// $ExpectType string
|
||||
poi.email;
|
||||
// $ExpectType LngLat | null
|
||||
poi.entr_location;
|
||||
// $ExpectType LngLat | null
|
||||
poi.exit_location;
|
||||
// $ExpectType boolean
|
||||
poi.groupbuy;
|
||||
if (poi.indoor_map) {
|
||||
const indoorData = poi.indoor_data;
|
||||
// $ExpectType string
|
||||
indoorData.cpid;
|
||||
// $ExpectType string
|
||||
indoorData.floor;
|
||||
// $ExpectType string
|
||||
indoorData.truefloor;
|
||||
}
|
||||
poi.pcode;
|
||||
// $ExpectType PoiPhoto[]
|
||||
poi.photos;
|
||||
// $ExpectType string
|
||||
poi.pname;
|
||||
// $ExpectType string
|
||||
poi.postcode;
|
||||
// $ExpectType string
|
||||
poi.website;
|
||||
|
||||
const photo = poi.photos[0];
|
||||
// $ExpectType string
|
||||
photo.title;
|
||||
// $ExpectType string
|
||||
photo.url;
|
||||
// $ExpectType Groupbuy[] | undefined
|
||||
poi.groupbuys;
|
||||
if (poi.groupbuys) {
|
||||
const groupbuy = poi.groupbuys[0];
|
||||
// $ExpectType string
|
||||
groupbuy.title;
|
||||
// $ExpectType string
|
||||
groupbuy.type_code;
|
||||
// $ExpectType string
|
||||
groupbuy.type;
|
||||
// $ExpectType string
|
||||
groupbuy.detail;
|
||||
// $ExpectType string
|
||||
groupbuy.stime;
|
||||
// $ExpectType string
|
||||
groupbuy.etime;
|
||||
// $ExpectType number
|
||||
groupbuy.count;
|
||||
// $ExpectType number
|
||||
groupbuy.sold_num;
|
||||
// $ExpectType number
|
||||
groupbuy.original_price;
|
||||
// $ExpectType number
|
||||
groupbuy.groupbuy_price;
|
||||
// $ExpectType number
|
||||
groupbuy.discount;
|
||||
// $ExpectType string
|
||||
groupbuy.ticket_address;
|
||||
// $ExpectType string
|
||||
groupbuy.ticket_tel;
|
||||
// $ExpectType PoiPhoto[]
|
||||
groupbuy.photos;
|
||||
// $ExpectType string
|
||||
groupbuy.url;
|
||||
// $ExpectType string
|
||||
groupbuy.provider;
|
||||
}
|
||||
// $ExpectType Discount[] | undefined
|
||||
poi.discounts;
|
||||
if (poi.discounts) {
|
||||
const discount = poi.discounts[0];
|
||||
// $ExpectType string
|
||||
discount.title;
|
||||
// $ExpectType string
|
||||
discount.detail;
|
||||
// $ExpectType string
|
||||
discount.start_time;
|
||||
// $ExpectType string
|
||||
discount.end_time;
|
||||
// $ExpectType number
|
||||
discount.sold_num;
|
||||
// $ExpectType PoiPhoto[]
|
||||
discount.photos;
|
||||
// $ExpectType string
|
||||
discount.url;
|
||||
// $ExpectType string
|
||||
discount.provider;
|
||||
}
|
||||
if (poi.deep_type === 'CINEMA') {
|
||||
// $ExpectType Cinema
|
||||
const cinema = poi.cinema;
|
||||
// $ExpectType string
|
||||
cinema.intro;
|
||||
// $ExpectType string
|
||||
cinema.rating;
|
||||
// $ExpectType string
|
||||
cinema.deep_src;
|
||||
// $ExpectType string
|
||||
cinema.parking;
|
||||
// $ExpectType string
|
||||
cinema.opentime_GDF;
|
||||
// $ExpectType string
|
||||
cinema.opentime;
|
||||
// $ExpectType PoiPhoto[]
|
||||
cinema.photos;
|
||||
}
|
||||
if (poi.deep_type === 'DINING') {
|
||||
// $ExpectType Dining
|
||||
const dining = poi.dining;
|
||||
// $ExpectType string
|
||||
dining.cuisines;
|
||||
// $ExpectType string
|
||||
dining.tag;
|
||||
// $ExpectType string
|
||||
dining.intro;
|
||||
// $ExpectType string
|
||||
dining.rating;
|
||||
// $ExpectType string
|
||||
dining.cp_rating;
|
||||
// $ExpectType string
|
||||
dining.deep_src;
|
||||
// $ExpectType string
|
||||
dining.taste_rating;
|
||||
// $ExpectType string
|
||||
dining.environment_rating;
|
||||
// $ExpectType string
|
||||
dining.service_rating;
|
||||
// $ExpectType string
|
||||
dining.cost;
|
||||
// $ExpectType string
|
||||
dining.recommend;
|
||||
// $ExpectType string
|
||||
dining.atmosphere;
|
||||
// $ExpectType string
|
||||
dining.ordering_wap_url;
|
||||
// $ExpectType string
|
||||
dining.ordering_web_url;
|
||||
// $ExpectType string
|
||||
dining.ordering_app_url;
|
||||
// $ExpectType string
|
||||
dining.opentime_GDF;
|
||||
// $ExpectType string
|
||||
dining.opentime;
|
||||
// $ExpectType string
|
||||
dining.addition;
|
||||
// $ExpectType PoiPhoto[]
|
||||
dining.photos;
|
||||
}
|
||||
if (poi.deep_type === 'SCENIC') {
|
||||
// $ExpectType Scenic
|
||||
const scenic = poi.scenic;
|
||||
// $ExpectType string
|
||||
scenic.intro;
|
||||
// $ExpectType string
|
||||
scenic.rating;
|
||||
// $ExpectType string
|
||||
scenic.deep_src;
|
||||
// $ExpectType string
|
||||
scenic.level;
|
||||
// $ExpectType string
|
||||
scenic.price;
|
||||
// $ExpectType string
|
||||
scenic.season;
|
||||
// $ExpectType string
|
||||
scenic.recommend;
|
||||
// $ExpectType string
|
||||
scenic.theme;
|
||||
// $ExpectType string
|
||||
scenic.ordering_wap_url;
|
||||
// $ExpectType string
|
||||
scenic.ordering_web_url;
|
||||
// $ExpectType string
|
||||
scenic.opentime_GDF;
|
||||
// $ExpectType string
|
||||
scenic.opentime;
|
||||
// $ExpectType PoiPhoto[]
|
||||
scenic.photos;
|
||||
}
|
||||
if (poi.deep_type === 'HOTEL') {
|
||||
// $ExpectType Hotel
|
||||
const hotel = poi.hotel;
|
||||
// $ExpectType string
|
||||
hotel.rating;
|
||||
// $ExpectType string
|
||||
hotel.star;
|
||||
// $ExpectType string
|
||||
hotel.intro;
|
||||
// $ExpectType string
|
||||
hotel.lowest_price;
|
||||
// $ExpectType string
|
||||
hotel.faci_rating;
|
||||
// $ExpectType string
|
||||
hotel.health_rating;
|
||||
// $ExpectType string
|
||||
hotel.environment_rating;
|
||||
// $ExpectType string
|
||||
hotel.service_rating;
|
||||
// $ExpectType string
|
||||
hotel.traffic;
|
||||
// $ExpectType string
|
||||
hotel.addition;
|
||||
// $ExpectType string
|
||||
hotel.deep_src;
|
||||
// $ExpectType PoiPhoto[]
|
||||
hotel.photos;
|
||||
}
|
||||
}
|
||||
|
||||
if (result.cityList) {
|
||||
const city = result.cityList[0];
|
||||
// $ExpectType string
|
||||
city.adcode;
|
||||
// $ExpectType string
|
||||
city.citycode;
|
||||
// $ExpectType number
|
||||
city.count;
|
||||
// $ExpectType string
|
||||
city.name;
|
||||
}
|
||||
} else {
|
||||
// $ExpectType string
|
||||
result;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.searchNearBy('keyword', lnglat, 10, (status, result) => {
|
||||
const temp: 'error' | 'complete' | 'no_data' = status;
|
||||
// $ExpectType string | SearchResult
|
||||
result;
|
||||
});
|
||||
// $ExpectType void
|
||||
placeSearch.searchNearBy('keyword', lnglatTuple, 10, () => { });
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.searchInBounds('keyword', bounds, (status, result) => {
|
||||
const temp: 'error' | 'complete' | 'no_data' = status;
|
||||
// $ExpectType string | SearchResult
|
||||
result;
|
||||
});
|
||||
// $ExpectType void
|
||||
placeSearch.searchInBounds('keyword', polygon, () => { });
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.getDetails('id', (status, result) => {
|
||||
const temp: 'error' | 'complete' | 'no_data' = status;
|
||||
// $ExpectType string | SearchResult
|
||||
result;
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setType('type');
|
||||
// $ExpectType void
|
||||
placeSearch.setType();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setCityLimit(true);
|
||||
// $ExpectType void
|
||||
placeSearch.setCityLimit();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setPageIndex(1);
|
||||
// $ExpectType void
|
||||
placeSearch.setPageIndex();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setPageSize(1);
|
||||
// $ExpectType void
|
||||
placeSearch.setPageSize();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setCity('city');
|
||||
// $ExpectType void
|
||||
placeSearch.setCity();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.setLang(lang);
|
||||
// $ExpectType void
|
||||
placeSearch.setLang();
|
||||
|
||||
// $ExpectType "zh_cn" | "en" | "zh_en" | undefined
|
||||
placeSearch.getLang();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.clear();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.poiOnAMAP({
|
||||
id: 'id',
|
||||
});
|
||||
// $ExpectType void
|
||||
placeSearch.poiOnAMAP({
|
||||
location: lnglat,
|
||||
id: 'id',
|
||||
name: 'name'
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.detailOnAMAP({
|
||||
id: 'id',
|
||||
});
|
||||
// $ExpectType void
|
||||
placeSearch.detailOnAMAP({
|
||||
location: lnglat,
|
||||
id: 'id',
|
||||
name: 'name'
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.open();
|
||||
|
||||
// $ExpectType void
|
||||
placeSearch.close();
|
||||
|
||||
placeSearch.on('complete', (event: AMap.PlaceSearch.EventMap['complete']) => {
|
||||
// $ExpectType "complete"
|
||||
event.type;
|
||||
// $ExpectType string
|
||||
event.info;
|
||||
// $ExpectType PoiList
|
||||
event.poiList;
|
||||
// $ExpectType string[] | undefined
|
||||
event.keywordList;
|
||||
// $ExpectType CityInfo[] | undefined
|
||||
event.cityList;
|
||||
});
|
||||
|
||||
placeSearch.on('listElementClick', (event: AMap.PlaceSearch.EventMap['listElementClick']) => {
|
||||
// $ExpectType MouseEvent
|
||||
event.event;
|
||||
// $ExpectType string
|
||||
event.id;
|
||||
// $ExpectType number
|
||||
event.index;
|
||||
// $ExpectType Marker<any>
|
||||
event.marker;
|
||||
// $ExpectType HTMLLIElement
|
||||
event.listElement;
|
||||
});
|
||||
|
||||
placeSearch.on('markerClick', (event: AMap.PlaceSearch.EventMap['markerClick']) => {
|
||||
const markerEvent = event.event;
|
||||
// $ExpectType Marker<any>
|
||||
markerEvent.target;
|
||||
// $ExpectType string
|
||||
event.id;
|
||||
// $ExpectType number
|
||||
event.index;
|
||||
// $ExpectType Marker<any>
|
||||
event.marker;
|
||||
// $ExpectType HTMLLIElement
|
||||
event.listElement;
|
||||
});
|
||||
+737
@@ -0,0 +1,737 @@
|
||||
// Type definitions for non-npm package amap-js-api-place-search 1.4
|
||||
// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.PlaceSearch
|
||||
// Definitions by: breeze9527 <https://github.com/breeze9527>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="amap-js-api" />
|
||||
|
||||
declare namespace AMap {
|
||||
namespace PlaceSearch {
|
||||
interface EventMap {
|
||||
complete: Event<'complete', SearchResult>;
|
||||
error: Event<'error', { info: string }>;
|
||||
selectChanged: Event<'selectChanged', {
|
||||
selected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'];
|
||||
lastSelected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'] | null;
|
||||
}>;
|
||||
listElementClick: SelectChangeEvent<'listElementClick', MouseEvent>;
|
||||
markerClick: SelectChangeEvent<'markerClick', Marker.EventMap['click']>;
|
||||
// internal
|
||||
renderComplete: Event<'renderComplete', {
|
||||
result: SelectChangeEventData[];
|
||||
markers: Marker[];
|
||||
listElements: HTMLElement[];
|
||||
}>;
|
||||
infoWindowClick: Event<'infoWindowClick', SelectChangeEventData & {
|
||||
event: MouseEvent;
|
||||
infoWindow: InfoWindow;
|
||||
infoWindowContentDom: HTMLDivElement;
|
||||
}>;
|
||||
willClear: Event<'willClear', {
|
||||
id: string;
|
||||
index: number;
|
||||
data: Poi[];
|
||||
}>;
|
||||
markerDestoryed: Event<'markerDestoryed', SelectChangeEventData>; // typo in source code
|
||||
listElementDetroyed: Event<'listElementDetroyed', SelectChangeEventData>; // typo too
|
||||
}
|
||||
|
||||
interface SelectChangeEventData {
|
||||
/**
|
||||
* 当前选中的POI的ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* 当前选中的POI对应的在地图中的Marker对象
|
||||
*/
|
||||
marker: Marker;
|
||||
/**
|
||||
* 当前选中的POI在结果面板中对应的列表项
|
||||
*/
|
||||
listElement: HTMLLIElement;
|
||||
/**
|
||||
* 当前选中的POI的信息
|
||||
*/
|
||||
data: Poi[];
|
||||
}
|
||||
type SelectChangeEvent<N extends string, E> = Event<N, SelectChangeEventData & {
|
||||
event: E;
|
||||
}>;
|
||||
interface PoiPhoto {
|
||||
/**
|
||||
* 图片名称
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* 图片url
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
interface PoiBase {
|
||||
/**
|
||||
* 全局唯一ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 兴趣点类型
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* 兴趣点经纬度
|
||||
*/
|
||||
location: LngLat | null;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
address: string;
|
||||
/**
|
||||
* 离中心点距离
|
||||
*/
|
||||
distance: number;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
tel: string;
|
||||
shopinfo: string;
|
||||
children?: any[]; // TODO Array<{location: LngLat | null}>
|
||||
}
|
||||
interface Groupbuy {
|
||||
/**
|
||||
* 团购标题
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* 团购分类代码
|
||||
*/
|
||||
type_code: string;
|
||||
/**
|
||||
* 团购分类
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* 团购详情
|
||||
*/
|
||||
detail: string;
|
||||
/**
|
||||
* 团购开始时间
|
||||
*/
|
||||
stime: string;
|
||||
/**
|
||||
* 团购结束时间
|
||||
*/
|
||||
etime: string;
|
||||
/**
|
||||
* 团购总量
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* 已卖出数量
|
||||
*/
|
||||
sold_num: number;
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
original_price: number;
|
||||
/**
|
||||
* 折扣价
|
||||
*/
|
||||
groupbuy_price: number;
|
||||
/**
|
||||
* 折扣
|
||||
*/
|
||||
discount: number;
|
||||
/**
|
||||
* 取票地址
|
||||
*/
|
||||
ticket_address: string;
|
||||
/**
|
||||
* 取票电话
|
||||
*/
|
||||
ticket_tel: string;
|
||||
/**
|
||||
* 图片信息
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
/**
|
||||
* 来源url
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* 来源标识
|
||||
*/
|
||||
provider: string;
|
||||
}
|
||||
interface Discount {
|
||||
/**
|
||||
* 优惠标题
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* 优惠详情
|
||||
*/
|
||||
detail: string;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
start_time: string;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
end_time: string;
|
||||
/**
|
||||
* 已卖出数量
|
||||
*/
|
||||
sold_num: number;
|
||||
/**
|
||||
* 图片信息列表
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
/**
|
||||
* 来源url
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* 来源标识
|
||||
*/
|
||||
provider: string;
|
||||
}
|
||||
interface Cinema {
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
intro: string;
|
||||
/**
|
||||
* 综合评分
|
||||
*/
|
||||
rating: string;
|
||||
/**
|
||||
* 信息来源
|
||||
*/
|
||||
deep_src: string;
|
||||
/**
|
||||
* 停车场设施
|
||||
*/
|
||||
parking: string;
|
||||
/**
|
||||
* 规范格式的营业时间
|
||||
*/
|
||||
opentime_GDF: string;
|
||||
/**
|
||||
* 非规范格式的营业时间
|
||||
*/
|
||||
opentime: string;
|
||||
/**
|
||||
* 图片信息列表
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
}
|
||||
interface Dining {
|
||||
/**
|
||||
* 菜系
|
||||
*/
|
||||
cuisines: string;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
tag: string;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
intro: string;
|
||||
/**
|
||||
* 综合评分
|
||||
*/
|
||||
rating: string;
|
||||
/**
|
||||
* 单数据源的评分
|
||||
*/
|
||||
cp_rating: string;
|
||||
/**
|
||||
* 信息来源
|
||||
*/
|
||||
deep_src: string;
|
||||
/**
|
||||
* 口味评分
|
||||
*/
|
||||
taste_rating: string;
|
||||
/**
|
||||
* 环境评分
|
||||
*/
|
||||
environment_rating: string;
|
||||
/**
|
||||
* 服务评分
|
||||
*/
|
||||
service_rating: string;
|
||||
/**
|
||||
* 人均消费
|
||||
*/
|
||||
cost: string;
|
||||
/**
|
||||
* 特色菜
|
||||
*/
|
||||
recommend: string;
|
||||
/**
|
||||
* 氛围
|
||||
*/
|
||||
atmosphere: string;
|
||||
/**
|
||||
* 订餐wap链接
|
||||
*/
|
||||
ordering_wap_url: string;
|
||||
/**
|
||||
* 订餐web链接
|
||||
*/
|
||||
ordering_web_url: string;
|
||||
/**
|
||||
* 订餐APP URL
|
||||
*/
|
||||
ordering_app_url: string;
|
||||
/**
|
||||
* 规范格式的营业时间
|
||||
*/
|
||||
opentime_GDF: string;
|
||||
/**
|
||||
* 非规范格式的营业时间
|
||||
*/
|
||||
opentime: string;
|
||||
/**
|
||||
* 餐厅特色
|
||||
*/
|
||||
addition: string;
|
||||
/**
|
||||
* 图片信息列表
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
}
|
||||
interface Scenic {
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
intro: string;
|
||||
/**
|
||||
* 综合评分
|
||||
*/
|
||||
rating: string;
|
||||
/**
|
||||
* 信息来源
|
||||
*/
|
||||
deep_src: string;
|
||||
/**
|
||||
* 景区国标级别
|
||||
*/
|
||||
level: string;
|
||||
/**
|
||||
* 门票价格
|
||||
*/
|
||||
price: string;
|
||||
/**
|
||||
* 适合游玩的季节
|
||||
*/
|
||||
season: string;
|
||||
/**
|
||||
* 推荐景点
|
||||
*/
|
||||
recommend: string;
|
||||
/**
|
||||
* 景区主题
|
||||
*/
|
||||
theme: string;
|
||||
/**
|
||||
* wap购票链接
|
||||
*/
|
||||
ordering_wap_url: string;
|
||||
/**
|
||||
* web购票链接
|
||||
*/
|
||||
ordering_web_url: string;
|
||||
/**
|
||||
* 规范格式的营业时间
|
||||
*/
|
||||
opentime_GDF: string;
|
||||
/**
|
||||
* 非规范格式的营业时间
|
||||
*/
|
||||
opentime: string;
|
||||
/**
|
||||
* 图片信息列表
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
}
|
||||
interface Hotel {
|
||||
/**
|
||||
* 综合评分
|
||||
*/
|
||||
rating: string;
|
||||
/**
|
||||
* 星级
|
||||
*/
|
||||
star: string;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
intro: string;
|
||||
/**
|
||||
* 最低房价
|
||||
*/
|
||||
lowest_price: string;
|
||||
/**
|
||||
* 设施评分
|
||||
*/
|
||||
faci_rating: string;
|
||||
/**
|
||||
* 卫生评分
|
||||
*/
|
||||
health_rating: string;
|
||||
/**
|
||||
* 环境评分
|
||||
*/
|
||||
environment_rating: string;
|
||||
/**
|
||||
* 服务评分
|
||||
*/
|
||||
service_rating: string;
|
||||
/**
|
||||
* 交通提示
|
||||
*/
|
||||
traffic: string;
|
||||
/**
|
||||
* 特色服务
|
||||
*/
|
||||
addition: string;
|
||||
/**
|
||||
* 信息来源
|
||||
*/
|
||||
deep_src: string;
|
||||
/**
|
||||
* 图片信息列表
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
}
|
||||
type PoiExt = PoiBase & {
|
||||
/**
|
||||
* 网址
|
||||
*/
|
||||
website: string;
|
||||
/**
|
||||
* 所在省份编码
|
||||
*/
|
||||
pcode: string;
|
||||
/**
|
||||
* 所在城市编码
|
||||
*/
|
||||
citycode: string;
|
||||
/**
|
||||
* 所在区域编码
|
||||
*/
|
||||
adcode: string;
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
postcode: string;
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
pname: string;
|
||||
/**
|
||||
* 所在城市名称
|
||||
*/
|
||||
cityname: string;
|
||||
/**
|
||||
* 所在行政区名称
|
||||
*/
|
||||
adname: string;
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* 照片
|
||||
*/
|
||||
photos: PoiPhoto[];
|
||||
/**
|
||||
* 入口经纬度
|
||||
*/
|
||||
entr_location: LngLat | null;
|
||||
/**
|
||||
* 出口经纬度
|
||||
*/
|
||||
exit_location: LngLat | null;
|
||||
/**
|
||||
* @deprecated 是否有团购信息
|
||||
*/
|
||||
groupbuy: boolean;
|
||||
/**
|
||||
* @deprecated 是否有优惠信息
|
||||
*/
|
||||
discount: boolean;
|
||||
} & ({
|
||||
indoor_map: true;
|
||||
indoor_data: {
|
||||
cpid: string;
|
||||
floor: string;
|
||||
truefloor: string;
|
||||
};
|
||||
} | {
|
||||
indoor_map: false;
|
||||
}) & {
|
||||
/**
|
||||
* @deprecated 团购信息
|
||||
*/
|
||||
groupbuys?: Groupbuy[];
|
||||
/**
|
||||
* @deprecated 优惠信息
|
||||
*/
|
||||
discounts?: Discount[];
|
||||
} & ({
|
||||
deep_type: 'CINEMA';
|
||||
/**
|
||||
* @deprecated 影院类深度信息
|
||||
*/
|
||||
cinema: Cinema;
|
||||
} | {
|
||||
deep_type: 'DINING';
|
||||
/**
|
||||
* @deprecated 餐饮类深度信息
|
||||
*/
|
||||
dining: Dining;
|
||||
} | {
|
||||
deep_type: 'SCENIC';
|
||||
/**
|
||||
* @deprecated 景点类深度信息
|
||||
*/
|
||||
scenic: Scenic;
|
||||
} | {
|
||||
deep_type: 'HOTEL';
|
||||
/**
|
||||
* @deprecated 酒店类深度信息
|
||||
*/
|
||||
hotel: Hotel;
|
||||
});
|
||||
interface Options {
|
||||
/**
|
||||
* 兴趣点城市
|
||||
*/
|
||||
city?: string;
|
||||
/**
|
||||
* 是否强制限制在设置的城市内搜索
|
||||
*/
|
||||
citylimit?: boolean;
|
||||
/**
|
||||
* 是否按照层级展示子POI数据
|
||||
* children=1,展示子节点POI数据,children=0,不展示子节点数据
|
||||
*/
|
||||
children?: number;
|
||||
/**
|
||||
* 兴趣点类别,多个类别用“|”分割
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* 检索语言类型
|
||||
*/
|
||||
lang?: Lang;
|
||||
/**
|
||||
* 单页显示结果条数
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 是否返回详细信息
|
||||
* base返回基本地址信息;all返回基本+详细信息
|
||||
*/
|
||||
extensions?: 'base' | 'all';
|
||||
/**
|
||||
* Map对象
|
||||
*/
|
||||
map?: Map;
|
||||
/**
|
||||
* 结果列表的HTML容器id或容器元素
|
||||
*/
|
||||
panel?: string | HTMLElement;
|
||||
/**
|
||||
* 是否在地图上显示周边搜索的圆或者范围搜索的多边形
|
||||
*/
|
||||
showCover?: boolean;
|
||||
/**
|
||||
* 绘制的UI风格
|
||||
*/
|
||||
renderStyle?: 'newpc' | 'default';
|
||||
/**
|
||||
* 是否自动调整地图视野使绘制的Marker点都处于视口的可见范围
|
||||
*/
|
||||
autoFitView?: boolean;
|
||||
|
||||
// internal
|
||||
renderEngine?: string;
|
||||
rankBy?: string;
|
||||
}
|
||||
interface PoiList {
|
||||
/**
|
||||
* Poi列表
|
||||
*/
|
||||
pois: Poi[]; // PlaceSearchPoiBase[] | PlaceSearchPoiExt[];
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageIndex: number;
|
||||
/**
|
||||
* 单页结果数
|
||||
*/
|
||||
pageSize: number;
|
||||
/**
|
||||
* 查询结果总数
|
||||
*/
|
||||
count: number;
|
||||
}
|
||||
interface CityInfo {
|
||||
/**
|
||||
* 建议城市名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
citycode: string;
|
||||
/**
|
||||
* 行政区编码
|
||||
*/
|
||||
adcode: string;
|
||||
/**
|
||||
* 该城市的建议结果数目
|
||||
*/
|
||||
count: number;
|
||||
}
|
||||
interface SearchResult {
|
||||
/**
|
||||
* 成功状态说明
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* 兴趣点列表
|
||||
*/
|
||||
poiList: PoiList;
|
||||
/**
|
||||
* 建议关键字列表
|
||||
*/
|
||||
keywordList?: string[];
|
||||
/**
|
||||
* 城市建议列表
|
||||
*/
|
||||
cityList?: CityInfo[];
|
||||
}
|
||||
type Poi = PoiBase | PoiExt;
|
||||
type SearchStatus = 'complete' | 'error' | 'no_data';
|
||||
}
|
||||
class PlaceSearch extends EventEmitter {
|
||||
/**
|
||||
* 地点搜索服务
|
||||
* @param options 选项
|
||||
*/
|
||||
constructor(options?: PlaceSearch.Options);
|
||||
/**
|
||||
* 根据关键字搜索
|
||||
* @param keyword 根据关键字搜索
|
||||
* @param callback 回调
|
||||
*/
|
||||
search(
|
||||
keyword: string,
|
||||
callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
|
||||
): void;
|
||||
/**
|
||||
* 周边查询
|
||||
* @param keyword 关键字
|
||||
* @param center 搜索中心
|
||||
* @param radius 搜索半径
|
||||
* @param callback 回调
|
||||
*/
|
||||
searchNearBy(
|
||||
keyword: string,
|
||||
center: LocationValue,
|
||||
radius: number,
|
||||
callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
|
||||
): void;
|
||||
/**
|
||||
* 根据范围和关键词进行范围查询
|
||||
* @param keyword 关键字
|
||||
* @param bounds 搜索范围
|
||||
* @param callback 回调
|
||||
*/
|
||||
searchInBounds(
|
||||
keyword: string,
|
||||
bounds: Bounds | Polygon,
|
||||
callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
|
||||
): void;
|
||||
/**
|
||||
* 根据POIID 查询POI 详细信息
|
||||
* @param POIID POIID
|
||||
* @param callback 搜索回调
|
||||
*/
|
||||
getDetails(
|
||||
POIID: string,
|
||||
callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
|
||||
): void;
|
||||
/**
|
||||
* 设置查询类别
|
||||
* @param type 查询类别
|
||||
*/
|
||||
setType(type?: string): void;
|
||||
/**
|
||||
* 设置是否强制限制城市
|
||||
* @param limit 是否强制限制城市
|
||||
*/
|
||||
setCityLimit(limit?: boolean): void;
|
||||
/**
|
||||
* 设置查询结果特定页数
|
||||
* @param pageIndex 页码
|
||||
*/
|
||||
setPageIndex(pageIndex?: number): void;
|
||||
/**
|
||||
* 设置查询单页结果数
|
||||
* @param pageSize 结果数
|
||||
*/
|
||||
setPageSize(pageSize?: number): void;
|
||||
/**
|
||||
* 设置查询城市
|
||||
* @param city 城市
|
||||
*/
|
||||
setCity(city?: string): void;
|
||||
/**
|
||||
* 设置检索语言类型
|
||||
* @param lang 语言类型
|
||||
*/
|
||||
setLang(lang?: Lang): void;
|
||||
/**
|
||||
* 获取检索语言类型
|
||||
*/
|
||||
getLang(): Lang | undefined;
|
||||
/**
|
||||
* 清除搜索结果
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* 唤起高德地图客户端marker页
|
||||
* @param obj 唤起参数
|
||||
*/
|
||||
poiOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void;
|
||||
/**
|
||||
* 唤起高德地图客户端POI详情页
|
||||
* @param obj 唤起参数
|
||||
*/
|
||||
detailOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void;
|
||||
|
||||
// internal
|
||||
open(): void;
|
||||
close(): void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noEmit": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"amap-js-api-place-search-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODOs
|
||||
"ban-types": false,
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
-4
@@ -26,10 +26,12 @@ import { EventEmitter } from "events";
|
||||
* Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session.
|
||||
*/
|
||||
declare const Bull: {
|
||||
(queueName: string, opts?: Bull.QueueOptions): Bull.Queue;
|
||||
(queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures
|
||||
new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue;
|
||||
new (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures
|
||||
/* tslint:disable:no-unnecessary-generics unified-signatures */
|
||||
<T = any>(queueName: string, opts?: Bull.QueueOptions): Bull.Queue<T>;
|
||||
<T = any>(queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue<T>;
|
||||
new <T = any>(queueName: string, opts?: Bull.QueueOptions): Bull.Queue<T>;
|
||||
new <T = any>(queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue<T>;
|
||||
/* tslint:enable:no-unnecessary-generics unified-signatures */
|
||||
};
|
||||
|
||||
declare namespace Bull {
|
||||
|
||||
Vendored
+4
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for cacheable-request 6.0
|
||||
// Project: https://github.com/lukechilds/cacheable-request#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Paul Melnikow <https://github.com/paulmelnikow>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -20,7 +21,7 @@ declare const CacheableRequest: CacheableRequest;
|
||||
type RequestFn = typeof request;
|
||||
|
||||
interface CacheableRequest {
|
||||
new (requestFn: RequestFn, storageAdapter?: string | Store<any>): (
|
||||
new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): (
|
||||
opts: string | URL | (RequestOptions & CacheSemanticsOptions),
|
||||
cb?: (response: ServerResponse | ResponseLike) => void
|
||||
) => CacheableRequest.Emitter;
|
||||
@@ -30,6 +31,8 @@ interface CacheableRequest {
|
||||
}
|
||||
|
||||
declare namespace CacheableRequest {
|
||||
type StorageAdapter = Store<any>;
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* If the cache should be used. Setting this to `false` will completely bypass the cache for the current request.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import center from "center-align";
|
||||
|
||||
// multi-line sample
|
||||
center([
|
||||
"Lorem ipsum dolor sit amet,",
|
||||
"consectetur adipiscing",
|
||||
"elit, sed do eiusmod tempor incididunt",
|
||||
"ut labore et dolore",
|
||||
"magna aliqua. Ut enim ad minim",
|
||||
"veniam, quis"
|
||||
]);
|
||||
|
||||
// single-line samples
|
||||
center("foo"); // => 'foo' (does nothing)
|
||||
center("foo", 12); // => ' foo '
|
||||
center("foo", 10); // => ' foo '
|
||||
center("foo", 8); // => ' foo '
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for center-align 1.0
|
||||
// Project: https://github.com/jonschlinkert/center-align
|
||||
// Definitions by: Claas Ahlrichs <https://github.com/claasahl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
declare function center_align(val: string, width?: number): string;
|
||||
declare function center_align(val: string[], width?: number): string[];
|
||||
|
||||
export = center_align;
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": ["index.d.ts", "center-align-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,16 @@
|
||||
import parseChangelog = require('changelog-parser');
|
||||
|
||||
const options = {
|
||||
filePath: 'path/to/CHANGELOG.md',
|
||||
removeMarkdown: false
|
||||
};
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result, error) => {});
|
||||
|
||||
parseChangelog(options, (result, error) => {});
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result) => {});
|
||||
|
||||
parseChangelog(options);
|
||||
|
||||
parseChangelog('path/to/CHANGELOG.md');
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for changelog-parser 2.7
|
||||
// Project: https://github.com/hypermodules/changelog-parser
|
||||
// Definitions by: Adam Zerella <https://github.com/adamzerella>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Path to changelog file.
|
||||
*/
|
||||
filePath: string;
|
||||
/**
|
||||
* Removes the markdown markup from the changelog entries by default.
|
||||
* You can change its value to false to keep the markdown.
|
||||
*/
|
||||
removeMarkdown: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change log parser for node.
|
||||
*/
|
||||
declare function parseChangelog(options: Partial<Options>|string, callback?: (result: object, error: string|null) => void): Promise<object>;
|
||||
|
||||
export = parseChangelog;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"changelog-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
+20
-18
@@ -10,26 +10,28 @@ import { Url } from 'url';
|
||||
|
||||
import * as core from "express-serve-static-core";
|
||||
|
||||
declare function historyApiFallback(options?: Options): core.RequestHandler;
|
||||
declare namespace historyApiFallback {}
|
||||
export = historyApiFallback;
|
||||
|
||||
interface Options {
|
||||
disableDotRule?: true;
|
||||
htmlAcceptHeaders?: string[];
|
||||
index?: string;
|
||||
logger?: typeof console.log;
|
||||
rewrites?: Rewrite[];
|
||||
verbose?: boolean;
|
||||
}
|
||||
declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler;
|
||||
|
||||
interface Context {
|
||||
match: RegExpMatchArray;
|
||||
parsedUrl: Url;
|
||||
}
|
||||
type RewriteTo = (context: Context) => string;
|
||||
declare namespace historyApiFallback {
|
||||
interface Options {
|
||||
disableDotRule?: true;
|
||||
htmlAcceptHeaders?: string[];
|
||||
index?: string;
|
||||
logger?: typeof console.log;
|
||||
rewrites?: Rewrite[];
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
interface Rewrite {
|
||||
from: RegExp;
|
||||
to: string | RegExp | RewriteTo;
|
||||
interface Context {
|
||||
match: RegExpMatchArray;
|
||||
parsedUrl: Url;
|
||||
}
|
||||
type RewriteTo = (context: Context) => string;
|
||||
|
||||
interface Rewrite {
|
||||
from: RegExp;
|
||||
to: string | RegExp | RewriteTo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DomHandler, DomHandlerOptions, Node } from "domhandler";
|
||||
import { DomHandler, DomHandlerOptions, Node, DomElement } from "domhandler";
|
||||
|
||||
const handler = new DomHandler((error: Error, dom: any) => {
|
||||
const handler = new DomHandler((error: Error, dom: DomElement[]) => {
|
||||
if (error)
|
||||
console.error('There has been an error...');
|
||||
else
|
||||
@@ -8,7 +8,7 @@ const handler = new DomHandler((error: Error, dom: any) => {
|
||||
});
|
||||
handler.ontext = (data: string) => { console.log(data); };
|
||||
handler.onreset = () => { console.log('We have a reset.'); };
|
||||
handler.onerror = (error: Error) => { console.error(Error); };
|
||||
handler.onopentag = (name: string, attribs) => { console.log(name, attribs); };
|
||||
handler.onerror = (error: Error) => { console.error(error); };
|
||||
handler.onopentag = (name: string, attribs: { [s: string]: string }) => { console.log(name, attribs); };
|
||||
|
||||
const dho: DomHandlerOptions = { normalizeWhitespace: true, withDomLvl1: true, withEndIndices: true, withStartIndices: true };
|
||||
|
||||
Vendored
-1
@@ -2,7 +2,6 @@
|
||||
// Project: https://github.com/fb55/DomHandler#readme
|
||||
// Definitions by: Johan Davidsson <https://github.com/johandavidson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export interface DomHandlerOptions {
|
||||
/***
|
||||
|
||||
Vendored
-1
@@ -2,7 +2,6 @@
|
||||
// Project: https://github.com/FB55/domutils#readme
|
||||
// Definitions by: Johan Davidsson <https://github.com/johandavidson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import { DomElement } from "domhandler";
|
||||
/***
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import elv = require('elv');
|
||||
|
||||
elv(''); // $ExpectType boolean
|
||||
|
||||
elv.behavior.enableFalse; // $ExpectedType boolean
|
||||
elv.behavior.enableNaN; // $ExpectedType boolean
|
||||
elv.behavior.enableNull; // $ExpectedType boolean
|
||||
elv.behavior.enableUndefined; // $ExpectedType boolean
|
||||
|
||||
elv.coalesce(''); // $ExpectType any
|
||||
elv.ncoalesce(''); // $ExpectType any
|
||||
elv.populated(''); // $ExpectType boolean
|
||||
elv.tryGet([], 0); // $ExpectType any
|
||||
elv.tryGet([], 0, ''); // $ExpectType any
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for elv 2.2
|
||||
// Project: https://github.com/dsfields/elv#readme
|
||||
// Definitions by: Gary Parker <https://github.com/garyaparker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function elv(val: any): boolean;
|
||||
|
||||
declare namespace elv {
|
||||
const behavior: {
|
||||
enableFalse: boolean
|
||||
enableNaN: boolean
|
||||
enableNull: boolean
|
||||
enableUndefined: boolean
|
||||
};
|
||||
function coalesce(...args: any[]): any;
|
||||
function ncoalesce(...args: any[]): any;
|
||||
function populated(val: any): boolean;
|
||||
function tryGet(val: ReadonlyArray<any>, index: number, def?: any): any;
|
||||
}
|
||||
|
||||
export = elv;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"elv-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+2
-2
@@ -2212,10 +2212,10 @@ export class Image {
|
||||
* Sets image element for this instance to a specified one.
|
||||
* If filters defined they are applied to new image.
|
||||
* You might need to call `canvas.renderAll` and `object.setCoords` after replacing, to render new image and update controls area.
|
||||
* @param [callback] Callback is invoked when all filters have been applied and new image is generated
|
||||
* @param element image element
|
||||
* @param [options] Options object
|
||||
*/
|
||||
setElement(element: HTMLImageElement, callback: Function, options: IImageOptions): Image;
|
||||
setElement(element: HTMLImageElement, options?: IImageOptions): Image;
|
||||
/**
|
||||
* Delete a single texture if in webgl mode
|
||||
*/
|
||||
|
||||
Vendored
+1
@@ -9,6 +9,7 @@
|
||||
// Bradley Hill <https://github.com/BradleyHill>
|
||||
// Bryan Krol <https://github.com/bmkrol823>
|
||||
// Glenn Gartner <https://github.com/glenngartner>
|
||||
// Codertx <https://github.com/codertx>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
export import fabric = require("./fabric-impl");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
||||
// Project: http://projectfluent.org
|
||||
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 3.3
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
@@ -76,7 +76,7 @@ export type Matching<InjectedProps, DecorationTargetProps> = {
|
||||
*/
|
||||
export type Shared<
|
||||
InjectedProps,
|
||||
DecorationTargetProps extends Shared<InjectedProps, DecorationTargetProps>
|
||||
DecorationTargetProps
|
||||
> = {
|
||||
[P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@ const bundle4 = new FluentBundle(['en-US'], {
|
||||
|
||||
// FluentBundle addMessages examples:
|
||||
bundle1.addMessages('foo = Foo');
|
||||
bundle2.hasMessage('foo');
|
||||
bundle2.getMessage('foo');
|
||||
|
||||
// FluentBundle addResource examples:
|
||||
@@ -42,3 +43,8 @@ bundle1.addMessages('hello = Hello, { $name }!');
|
||||
const hello = bundle2.getMessage('hello');
|
||||
bundle3.format(hello, { name: 'Jane' }, errors2);
|
||||
bundle3.format(hello, undefined, errors2);
|
||||
|
||||
for (const [id, message] of bundle1.messages) {
|
||||
bundle1.getMessage(id);
|
||||
bundle1.format(message);
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for fluent 0.10
|
||||
// Type definitions for fluent 0.11
|
||||
// Project: http://projectfluent.org
|
||||
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
|
||||
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>, James Nimlos <https://github.com/jamesnimlos>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -28,6 +28,8 @@ export class FluentResource extends Map {
|
||||
|
||||
export class FluentBundle {
|
||||
constructor(locales: string | string[], options?: FluentBundleContructorOptions);
|
||||
messages: IterableIterator<[string, FluentNode[]]>;
|
||||
hasMessage(source: string): boolean;
|
||||
addMessages(source: string): string[];
|
||||
getMessage(id: string): FluentNode[];
|
||||
format(message: FluentNode[], args?: object, errors?: string[]): string;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import createFormatNumber from "format-number";
|
||||
|
||||
createFormatNumber({ round: 2 }); // $ExpectType (number: number, overrideOptions?: { noUnits: boolean; noSeparator: boolean; } | undefined) => string
|
||||
|
||||
createFormatNumber({ round: 2 })(12); // $ExpectType string
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for format-number 2.0
|
||||
// Project: https://github.com/componitable/format-number
|
||||
// Definitions by: Fedai Kaya <https://github.com/codelovesme>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function(options?: {
|
||||
negativeType?: "right" | "left" | "brackets" | null;
|
||||
negativeLeftSymbol?: string;
|
||||
negative?: "R" | null;
|
||||
negativeRightSymbol?: string;
|
||||
negativeLeftOut?: boolean;
|
||||
negativeOut?: boolean;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
integerSeparator?: string;
|
||||
separator?: string;
|
||||
decimalsSeparator?: string;
|
||||
decimal?: string;
|
||||
padLeft?: number;
|
||||
padRight?: number;
|
||||
round?: number;
|
||||
truncate?: number;
|
||||
allowedSeparators?: string[];
|
||||
}): (
|
||||
number: number,
|
||||
overrideOptions?: {
|
||||
noUnits: boolean;
|
||||
noSeparator: boolean;
|
||||
}
|
||||
) => string;
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "format-number-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,10 +0,0 @@
|
||||
import getPort = require('get-port');
|
||||
|
||||
// $ExpectType Promise<number>
|
||||
getPort();
|
||||
// $ExpectType Promise<number>
|
||||
getPort({ port: 3000 });
|
||||
// $ExpectType Promise<number>
|
||||
getPort({ port: [3000, 3001] });
|
||||
// $ExpectType Promise<number>
|
||||
getPort({ host: 'foo.local' });
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
// Type definitions for get-port 4.0
|
||||
// Project: https://github.com/sindresorhus/get-port
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function getPort(options?: {
|
||||
port?: number | ReadonlyArray<number>;
|
||||
host?: string;
|
||||
}): Promise<number>;
|
||||
|
||||
export = getPort;
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import gulpTap = require('gulp-tap');
|
||||
import gulp = require('gulp');
|
||||
import Vinyl = require('vinyl');
|
||||
|
||||
gulp.task('testTask', () => {
|
||||
return gulp.src(['src/*.html'])
|
||||
.pipe(gulpTap((sourceFile: Vinyl) => {
|
||||
console.log(sourceFile.path);
|
||||
}))
|
||||
.pipe(gulp.dest('dist/'));
|
||||
});
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for gulp-tap 1.0
|
||||
// Project: https://github.com/geejs/gulp-tap
|
||||
// Definitions by: Takesi Tokugawa <https://github.com/TokugawaTakesi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import Vinyl = require('vinyl');
|
||||
|
||||
declare namespace tap {
|
||||
interface Tap {
|
||||
(tapFunction: TapFunction, t?: any): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
interface TapFunction {
|
||||
(file: Vinyl): any;
|
||||
}
|
||||
}
|
||||
|
||||
declare function tap(tapFunction: (file: Vinyl, t?: {}) => void): NodeJS.ReadWriteStream;
|
||||
|
||||
export = tap;
|
||||
@@ -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",
|
||||
"gulp-tap-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,23 +1,30 @@
|
||||
/**
|
||||
* Created by staticfunction on 8/4/14.
|
||||
*/
|
||||
import htmlparser = require("htmlparser2");
|
||||
import htmlparser = require('htmlparser2');
|
||||
|
||||
var parser = new htmlparser.Parser({
|
||||
onopentag: (name:string, attribs:{[s:string]:string}) => {
|
||||
if(name === "script" && attribs['type'] === "text/javascript"){
|
||||
console.log("JS! Hooray!");
|
||||
}
|
||||
},
|
||||
ontext: (text: string) => {
|
||||
console.log("-->", text);
|
||||
},
|
||||
onclosetag: (tagname:string) => {
|
||||
if(tagname === "script"){
|
||||
console.log("That's it?!");
|
||||
}
|
||||
const options: htmlparser.DomHandlerOptions = { withEndIndices: false, withDomLvl1: true }
|
||||
const dh = new htmlparser.DomHandler((err: Error, dom: htmlparser.DomElement[]) => {
|
||||
if(err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
// Use DomUtils to get name of first element in dom
|
||||
console.log(htmlparser.DomUtils.getName(dom[0]));
|
||||
}, options);
|
||||
dh.onopentag = (name:string, attribs:{[s:string]:string}) => {
|
||||
if(name === "script" && attribs['type'] === "text/javascript"){
|
||||
console.log("JS! Hooray!");
|
||||
}
|
||||
};
|
||||
dh.ontext = (text: string) => {
|
||||
console.log("-->", text);
|
||||
};
|
||||
dh.onclosetag = () => {
|
||||
console.log("That's it?!");
|
||||
};
|
||||
|
||||
var parser = new htmlparser.Parser(dh);
|
||||
|
||||
parser.write("Xyz <script type='text/javascript'>var foo = '<<bar>>';</script>");
|
||||
parser.end();
|
||||
|
||||
Vendored
+47
-21
@@ -1,30 +1,20 @@
|
||||
// Type definitions for htmlparser2 v3.7.x
|
||||
// Type definitions for htmlparser2 v3.10.x
|
||||
// Project: https://github.com/fb55/htmlparser2/
|
||||
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Johan Davidsson <https://github.com/johandavidson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference types="node"/>
|
||||
///<reference types="domhandler"/>
|
||||
///<reference types="domutils"/>
|
||||
|
||||
import { Writable } from 'stream'
|
||||
import { DomHandler } from 'domhandler';
|
||||
import * as DomUtils from 'domutils';
|
||||
export { DomElement, DomHandlerOptions, DomHandler, Element, Node } from 'domhandler';
|
||||
|
||||
export interface Handler {
|
||||
onopentag?: (name: string, attribs: { [type: string]: string }) => void;
|
||||
onopentagname?: (name: string) => void;
|
||||
onattribute?: (name: string, value: string) => void;
|
||||
ontext?: (text: string) => void;
|
||||
onclosetag?: (text: string) => void;
|
||||
onprocessinginstruction?: (name: string, data: string) => void;
|
||||
oncomment?: (data: string) => void;
|
||||
oncommentend?: () => void;
|
||||
oncdatastart?: () => void;
|
||||
oncdataend?: () => void;
|
||||
onerror?: (error: Error) => void;
|
||||
onreset?: () => void;
|
||||
onend?: () => void;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
export interface ParserOptions {
|
||||
|
||||
/***
|
||||
* Indicates whether special tags (<script> and <style>) should get special treatment
|
||||
@@ -61,33 +51,53 @@ export interface Options {
|
||||
*/
|
||||
recognizeSelfClosing?: boolean;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export type Options = ParserOptions
|
||||
|
||||
export declare class WritableStream extends Writable {
|
||||
constructor(handler: Handler, options?: Options);
|
||||
constructor(handler: DomHandler, options?: ParserOptions);
|
||||
}
|
||||
|
||||
export declare class Parser {
|
||||
constructor(handler: Handler, options?: Options);
|
||||
constructor(handler: DomHandler, options?: ParserOptions);
|
||||
|
||||
/***
|
||||
* Parses a chunk of data and calls the corresponding callbacks.
|
||||
* @param input
|
||||
*/
|
||||
write(input: string): void;
|
||||
|
||||
/***
|
||||
* alias for backwards compat
|
||||
*/
|
||||
parseChunk(input: string): void;
|
||||
parseChunk(chunk: string): void;
|
||||
|
||||
/***
|
||||
* Parses the end of the buffer and clears the stack, calls onend.
|
||||
*/
|
||||
end(): void;
|
||||
|
||||
/***
|
||||
* Parses the end of the buffer and clears the stack, calls onend.
|
||||
*/
|
||||
end(chunk: string): void;
|
||||
|
||||
/***
|
||||
* alias for backwards compat
|
||||
*/
|
||||
done(): void;
|
||||
|
||||
/***
|
||||
* Pauses the parser
|
||||
*/
|
||||
pause(): void;
|
||||
|
||||
/***
|
||||
* Resumes the parser
|
||||
*/
|
||||
resume(): void;
|
||||
|
||||
/***
|
||||
* Resets the parser, parses the data & calls end.
|
||||
@@ -99,4 +109,20 @@ export declare class Parser {
|
||||
* Resets buffer & stack, calls onreset.
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
ontext(data: any): void;
|
||||
onopentagname(name: string): void;
|
||||
onopentagend(): void;
|
||||
onclosetag(name: string): void;
|
||||
onselfclosingtag(): void;
|
||||
onattribname(name: string): void;
|
||||
onattribend(): void;
|
||||
ondeclaration(): void;
|
||||
onprocessinginstruction(value: string): void;
|
||||
oncomment(value: string): void;
|
||||
oncdata(value: string): void;
|
||||
onerror(err: Error): void;
|
||||
onend(): void;
|
||||
}
|
||||
|
||||
export { DomUtils }
|
||||
|
||||
@@ -6,8 +6,8 @@ const opts: GracefulShutdown.Options = {
|
||||
signals: "SIGINT SIGTERM",
|
||||
timeout: 1337,
|
||||
development: false,
|
||||
onShutdown: () => {
|
||||
console.log('fake shutdown handler');
|
||||
onShutdown: (signal) => {
|
||||
console.log('fake shutdown handler', signal);
|
||||
return Promise.resolve();
|
||||
},
|
||||
finally: () => {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ declare namespace GracefulShutdown {
|
||||
signals?: string;
|
||||
timeout?: number;
|
||||
development?: boolean;
|
||||
onShutdown?: () => Promise<void>;
|
||||
onShutdown?: (signal: string) => Promise<void>;
|
||||
finally?: () => void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODOs
|
||||
"ban-types": false,
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+10
-12
@@ -16,12 +16,18 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="koa" />
|
||||
|
||||
declare module "koa-compress" {
|
||||
import * as Koa from "koa";
|
||||
import * as zlib from "zlib";
|
||||
|
||||
import * as Koa from "koa";
|
||||
import * as zlib from "zlib";
|
||||
/**
|
||||
* Compress middleware for Koa
|
||||
*/
|
||||
declare function koaCompress(options?: koaCompress.CompressOptions): Koa.Middleware;
|
||||
|
||||
interface CompressOptions extends zlib.ZlibOptions {
|
||||
export = koaCompress;
|
||||
|
||||
declare namespace koaCompress {
|
||||
export interface CompressOptions extends zlib.ZlibOptions {
|
||||
/**
|
||||
* An optional function that checks the response content type to decide whether to compress. By default, it uses compressible.
|
||||
*/
|
||||
@@ -32,12 +38,4 @@ declare module "koa-compress" {
|
||||
*/
|
||||
threshold?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress middleware for Koa
|
||||
*/
|
||||
function compress(options?: CompressOptions): Koa.Middleware;
|
||||
|
||||
namespace compress {}
|
||||
export = compress;
|
||||
}
|
||||
|
||||
+7
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Leaflet.markercluster 1.0
|
||||
// Type definitions for Leaflet.markercluster 1.4
|
||||
// Project: https://github.com/Leaflet/Leaflet.markercluster
|
||||
// Definitions by: Robert Imig <https://github.com/rimig>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -115,6 +115,12 @@ declare module 'leaflet' {
|
||||
* Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms.
|
||||
*/
|
||||
chunkDelay?: number;
|
||||
|
||||
/*
|
||||
* Time interval (in ms) during which addLayers works before pausing to let the rest of the page process.
|
||||
* In particular, this prevents the page from freezing while adding a lot of markers. Defaults to 200ms.
|
||||
*/
|
||||
chunkInterval?: number;
|
||||
}
|
||||
|
||||
class MarkerClusterGroup extends FeatureGroup {
|
||||
|
||||
@@ -26,7 +26,8 @@ markerClusterGroupOptions = {
|
||||
return icon;
|
||||
},
|
||||
chunkedLoading: false,
|
||||
chunkDelay: 100
|
||||
chunkDelay: 100,
|
||||
chunkInterval: 200,
|
||||
};
|
||||
|
||||
markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => {
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// Type definitions for license-checker-webpack-plugin 0.0
|
||||
// Project: https://github.com/Microsoft/license-checker-webpack-plugin#readme
|
||||
// Definitions by: Joel Spadin <https://github.com/ChaosinaCan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
declare class LicenseCheckerWebpackPlugin extends Plugin {
|
||||
constructor(options: LicenseCheckerWebpackPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace LicenseCheckerWebpackPlugin {
|
||||
interface Dependency {
|
||||
name: string;
|
||||
version: string;
|
||||
repository: string;
|
||||
licenseName: string;
|
||||
licenseText: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Regular expression that matches the file paths of dependencies to check.
|
||||
*/
|
||||
filter?: RegExp;
|
||||
|
||||
/**
|
||||
* SPDX expression with allowed licenses.
|
||||
*
|
||||
* Default: `"(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT)"`
|
||||
*/
|
||||
allow?: string;
|
||||
|
||||
/**
|
||||
* Array of dependencies to ignore, in the format `["<dependency name>@<version range>"]`.
|
||||
* For example, `["assignment@^2.0.0"]`.
|
||||
*
|
||||
* Default: `[]`
|
||||
*/
|
||||
ignore?: string[];
|
||||
|
||||
/**
|
||||
* Object of dependencies to override, in the format `{"<dependency name>@<version range>": { ... }}`.
|
||||
* For example, `{"assignment@^2.0.0": { licenseName: "MIT" }}`.
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
override?: Record<string, Partial<Dependency>>;
|
||||
|
||||
/**
|
||||
* Whether to emit errors instead of warnings.
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
emitError?: boolean;
|
||||
|
||||
/**
|
||||
* Path to a `.ejs` template, or function that will generate the contents
|
||||
* of the third-party notices file.
|
||||
*/
|
||||
outputWriter?: string | ((dependencies: Dependency[]) => string);
|
||||
|
||||
/**
|
||||
* Name of the third-party notices file with all licensing information.
|
||||
*
|
||||
* Default: `"ThirdPartyNotices.txt"`
|
||||
*/
|
||||
outputFilename?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = LicenseCheckerWebpackPlugin;
|
||||
@@ -0,0 +1,24 @@
|
||||
import * as path from 'path';
|
||||
import LicenseCheckerWebpackPlugin = require('license-checker-webpack-plugin');
|
||||
|
||||
// $ExpectType LicenseCheckerWebpackPlugin
|
||||
new LicenseCheckerWebpackPlugin({
|
||||
allow: "(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT)",
|
||||
ignore: ["@microsoft/*"],
|
||||
override: {
|
||||
"assignment@2.0.0": { licenseName: "MIT" },
|
||||
"intersection-observer@0.5.0": { licenseName: "MIT" },
|
||||
"querystring-es3@0.2.1": { licenseName: "MIT" }
|
||||
},
|
||||
emitError: true,
|
||||
outputWriter: path.resolve(__dirname, "customTemplate.ejs"),
|
||||
outputFilename: "ThirdPartyNotices.txt"
|
||||
});
|
||||
|
||||
// $ExpectType LicenseCheckerWebpackPlugin
|
||||
new LicenseCheckerWebpackPlugin({
|
||||
filter: /.*/,
|
||||
outputWriter: (dependencies) => {
|
||||
return dependencies.map(d => `${d.name} ${d.licenseName}`).join('\n');
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"license-checker-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -2989,6 +2989,12 @@ declare module "mongoose" {
|
||||
create(...docs: any[]): Promise<T>;
|
||||
create(...docsWithCallback: any[]): Promise<T>;
|
||||
|
||||
/**
|
||||
* Create the collection for this model. By default, if no indexes are specified, mongoose will not create the
|
||||
* collection for the model until any documents are created. Use this method to create the collection explicitly.
|
||||
*/
|
||||
createCollection(options?: mongodb.CollectionCreateOptions, cb?: (err: any) => void): Promise<void>;
|
||||
|
||||
/**
|
||||
* Adds a discriminator type.
|
||||
* @param name discriminator model name
|
||||
|
||||
@@ -1648,6 +1648,9 @@ MongoModel.create([{ type: 'jelly bean' }, {
|
||||
arg[0].save();
|
||||
arg[1].save();
|
||||
});
|
||||
MongoModel.createCollection().then(() => {});
|
||||
MongoModel.createCollection({ capped: true, max: 42 }).then(() => {});
|
||||
MongoModel.createCollection({ capped: true, max: 42 }, err => {});
|
||||
MongoModel.distinct('url', { clicks: {$gt: 100}}, function (err, result) {
|
||||
});
|
||||
MongoModel.distinct('url').exec(cb);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"dt-header": false
|
||||
"npm-naming": false,
|
||||
"dt-header": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+20
-9
@@ -118,13 +118,15 @@ declare module "crypto" {
|
||||
type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
|
||||
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
||||
|
||||
interface Hash extends NodeJS.ReadWriteStream {
|
||||
class Hash extends stream.Duplex {
|
||||
private constructor();
|
||||
update(data: BinaryLike): Hash;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
interface Hmac extends NodeJS.ReadWriteStream {
|
||||
class Hmac extends stream.Duplex {
|
||||
private constructor();
|
||||
update(data: BinaryLike): Hmac;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
||||
digest(): Buffer;
|
||||
@@ -133,7 +135,8 @@ declare module "crypto" {
|
||||
|
||||
export type KeyObjectType = 'secret' | 'public' | 'private';
|
||||
|
||||
interface KeyObject {
|
||||
class KeyObject {
|
||||
private constructor();
|
||||
asymmetricKeyType?: KeyType;
|
||||
export(options?: {
|
||||
type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1',
|
||||
@@ -182,7 +185,8 @@ declare module "crypto" {
|
||||
algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
|
||||
): Cipher;
|
||||
|
||||
interface Cipher extends NodeJS.ReadWriteStream {
|
||||
class Cipher extends stream.Duplex {
|
||||
private constructor();
|
||||
update(data: BinaryLike): Buffer;
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
|
||||
update(data: Binary, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
|
||||
@@ -222,7 +226,8 @@ declare module "crypto" {
|
||||
): DecipherGCM;
|
||||
function createDecipheriv(algorithm: string, key: BinaryLike, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
|
||||
|
||||
interface Decipher extends NodeJS.ReadWriteStream {
|
||||
class Decipher extends stream.Duplex {
|
||||
private constructor();
|
||||
update(data: Binary): Buffer;
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
|
||||
update(data: Binary, input_encoding: undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
@@ -268,7 +273,9 @@ declare module "crypto" {
|
||||
|
||||
type KeyLike = string | Buffer | KeyObject;
|
||||
|
||||
interface Signer extends NodeJS.WritableStream {
|
||||
class Signer extends stream.Writable {
|
||||
private constructor();
|
||||
|
||||
update(data: BinaryLike): Signer;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
sign(private_key: SignPrivateKeyInput | KeyLike): Buffer;
|
||||
@@ -276,11 +283,13 @@ declare module "crypto" {
|
||||
}
|
||||
|
||||
function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
|
||||
interface Verify extends NodeJS.WritableStream {
|
||||
class Verify extends stream.Writable {
|
||||
private constructor();
|
||||
|
||||
update(data: BinaryLike): Verify;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
||||
verify(object: Object | KeyLike, signature: Binary): boolean;
|
||||
verify(object: Object | KeyLike, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
|
||||
verify(object: Object | KeyLike, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
|
||||
// https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
|
||||
// The signature field accepts a TypedArray type, but it is only available starting ES2017
|
||||
}
|
||||
@@ -289,7 +298,8 @@ declare module "crypto" {
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Binary): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
interface DiffieHellman {
|
||||
class DiffieHellman {
|
||||
private constructor();
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: Binary): Buffer;
|
||||
@@ -368,6 +378,7 @@ declare module "crypto" {
|
||||
function getCurves(): string[];
|
||||
function getHashes(): string[];
|
||||
class ECDH {
|
||||
private constructor();
|
||||
static convertKey(
|
||||
key: BinaryLike,
|
||||
curve: string,
|
||||
|
||||
Vendored
+1
-1
@@ -415,7 +415,7 @@ declare module "http2" {
|
||||
peerMaxConcurrentStreams?: number;
|
||||
selectPadding?: (frameLen: number, maxFrameLen: number) => number;
|
||||
settings?: Settings;
|
||||
createConnection?: (option: SessionOptions) => stream.Duplex;
|
||||
createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
|
||||
}
|
||||
|
||||
export type ClientSessionOptions = SessionOptions;
|
||||
|
||||
@@ -486,6 +486,42 @@ import { promisify } from 'util';
|
||||
crypto.createSecretKey(Buffer.from('asdf'));
|
||||
}
|
||||
|
||||
{
|
||||
const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
|
||||
namedCurve: 'sect239k1'
|
||||
});
|
||||
|
||||
const sign: crypto.Signer = crypto.createSign('SHA256');
|
||||
sign.write('some data to sign');
|
||||
sign.end();
|
||||
const signature: string = sign.sign(privateKey, 'hex');
|
||||
|
||||
const verify: crypto.Verify = crypto.createVerify('SHA256');
|
||||
verify.write('some data to sign');
|
||||
verify.end();
|
||||
verify.verify(publicKey, signature); // $ExpectType boolean
|
||||
|
||||
// ensure that instanceof works
|
||||
verify instanceof crypto.Verify;
|
||||
sign instanceof crypto.Signer;
|
||||
}
|
||||
|
||||
{
|
||||
const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
|
||||
modulusLength: 2048,
|
||||
});
|
||||
|
||||
const sign: crypto.Signer = crypto.createSign('SHA256');
|
||||
sign.update('some data to sign');
|
||||
sign.end();
|
||||
const signature: Buffer = sign.sign(privateKey);
|
||||
|
||||
const verify: crypto.Verify = crypto.createVerify('SHA256');
|
||||
verify.update('some data to sign');
|
||||
verify.end();
|
||||
verify.verify(publicKey, signature); // $ExpectType boolean
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_constants_test
|
||||
let num: number;
|
||||
|
||||
Vendored
+1
-1
@@ -415,7 +415,7 @@ declare module "http2" {
|
||||
peerMaxConcurrentStreams?: number;
|
||||
selectPadding?: (frameLen: number, maxFrameLen: number) => number;
|
||||
settings?: Settings;
|
||||
createConnection?: (option: SessionOptions) => stream.Duplex;
|
||||
createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
|
||||
}
|
||||
|
||||
export type ClientSessionOptions = SessionOptions;
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for nonogram-solver 2.0
|
||||
// Project: https://github.com/thomasr/nonogram-solver
|
||||
// Definitions by: Florian Keller <https://github.com/me>
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -968,11 +968,11 @@ declare namespace Office {
|
||||
*
|
||||
* *Supported hosts, by platform*
|
||||
* <table>
|
||||
* <tr><th> </th><th> Office for Windows desktop </th><th> Office Online (in browser) </th><th> Office for iPad </th></tr>
|
||||
* <tr><td><strong> Excel </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Outlook </strong></td><td> Y (Mailbox 1.3: without `options` parameter;<br>Mailbox Preview: adds support for `options` parameter)</td><td> </td><td> </td></tr>
|
||||
* <tr><td><strong> PowerPoint </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Word </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><th> </th><th> Office for Windows desktop </th><th> Office Online (in browser) </th><th> Office for iPad </th></tr>
|
||||
* <tr><td><strong> Excel </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Outlook </strong></td><td> Y (Since Mailbox 1.3: without `options` parameter;<br>Mailbox Preview: adds support for `options` parameter)</td><td> </td><td> </td></tr>
|
||||
* <tr><td><strong> PowerPoint </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Word </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* </table>
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
|
||||
Vendored
+5
-5
@@ -962,11 +962,11 @@ declare namespace Office {
|
||||
*
|
||||
* *Supported hosts, by platform*
|
||||
* <table>
|
||||
* <tr><th> </th><th> Office for Windows desktop </th><th> Office Online (in browser) </th><th> Office for iPad </th></tr>
|
||||
* <tr><td><strong> Excel </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Outlook </strong></td><td> Y (Mailbox 1.3: without `options` parameter;<br>Mailbox Preview: adds support for `options` parameter)</td><td> </td><td> </td></tr>
|
||||
* <tr><td><strong> PowerPoint </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Word </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><th> </th><th> Office for Windows desktop </th><th> Office Online (in browser) </th><th> Office for iPad </th></tr>
|
||||
* <tr><td><strong> Excel </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Outlook </strong></td><td> Y (Since Mailbox 1.3: without `options` parameter;<br>Mailbox Preview: adds support for `options` parameter)</td><td> </td><td> </td></tr>
|
||||
* <tr><td><strong> PowerPoint </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* <tr><td><strong> Word </strong></td><td> Y </td><td> Y </td><td> Y </td></tr>
|
||||
* </table>
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
|
||||
Vendored
+1
-1
@@ -691,7 +691,7 @@ subscription.on('close', () => {});
|
||||
static extend(protoProps?: any, classProps?: any): any;
|
||||
static hydrate(userJSON: any): Promise<User>;
|
||||
|
||||
signUp(attrs: any, options?: SignUpOptions): Promise<this>;
|
||||
signUp(attrs?: any, options?: SignUpOptions): Promise<this>;
|
||||
logIn(options?: SuccessFailureOptions): Promise<this>;
|
||||
authenticated(): boolean;
|
||||
isCurrent(): boolean;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# This package uses tabs
|
||||
[*]
|
||||
indent_style = tab
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
// Type definitions for prefixfree 1.0
|
||||
// Project: https://github.com/LeaVerou/prefixfree
|
||||
// Definitions by: ExE Boss <https://github.com/ExE-Boss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
declare namespace StyleFix {
|
||||
type StyleFixer = (css: string, raw: boolean, element: Element) => string;
|
||||
}
|
||||
|
||||
interface StyleFix {
|
||||
fix: StyleFix.StyleFixer;
|
||||
fixers?: StyleFix.StyleFixer[];
|
||||
optIn: boolean;
|
||||
camelCase(str: string): string;
|
||||
deCamelCase(str: string): string;
|
||||
link(link: HTMLLinkElement): void;
|
||||
process(): void;
|
||||
register(fixer: StyleFix.StyleFixer, index?: number): void;
|
||||
styleAttribute(element: ElementCSSInlineStyle): void;
|
||||
styleElement(style: HTMLStyleElement): void;
|
||||
}
|
||||
|
||||
declare const StyleFix: StyleFix;
|
||||
|
||||
// PrefixFree
|
||||
declare namespace PrefixFree {
|
||||
/** The known prefixes used for CSS properties. */
|
||||
type KnownPrefixCSS = "-moz-" | "-ms-" | "-o-" | "-webkit-";
|
||||
|
||||
/** The known prefixes used for CSS properties in `CSSStyleDeclaration`. */
|
||||
type KnownPrefixJS = "Moz" | "Ms" | "O" | "Webkit";
|
||||
}
|
||||
|
||||
interface PrefixFree {
|
||||
/**
|
||||
* The prefix used for CSS properties.
|
||||
*
|
||||
* Eg.: `-moz-`, `-ms-`, `-o-` or `-webkit-`.
|
||||
*/
|
||||
prefix: PrefixFree.KnownPrefixCSS | string;
|
||||
|
||||
/**
|
||||
* The prefix used for CSS properties in `CSSStyleDeclaration`.
|
||||
*
|
||||
* Eg.: `Moz`, `Ms`, `O` or `Webkit`.
|
||||
*/
|
||||
Prefix: PrefixFree.KnownPrefixJS | string;
|
||||
|
||||
atrules: string[];
|
||||
functions: string[];
|
||||
keywords: string[];
|
||||
properties: string[];
|
||||
selectorMap: {
|
||||
[selector: string]: string;
|
||||
};
|
||||
selectors: string[];
|
||||
valueProperties: string[];
|
||||
|
||||
prefixCSS: StyleFix.StyleFixer;
|
||||
prefixProperty(property: string, camelCase?: boolean): string;
|
||||
prefixSelector(selector: string): string;
|
||||
property(property: string): string;
|
||||
value(value: string, property?: string): string;
|
||||
}
|
||||
|
||||
declare const PrefixFree: PrefixFree;
|
||||
|
||||
interface Window {
|
||||
StyleFix: StyleFix;
|
||||
PrefixFree: PrefixFree;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
window.StyleFix === StyleFix;
|
||||
window.PrefixFree === PrefixFree;
|
||||
|
||||
StyleFix.register((css, raw, element) => {
|
||||
return css + "\n/* Custom end comment */\n";
|
||||
});
|
||||
StyleFix.process();
|
||||
|
||||
const browser = (() => {
|
||||
switch (PrefixFree.prefix) {
|
||||
case "-moz-":
|
||||
return "firefox";
|
||||
case "-ms-":
|
||||
return "ie";
|
||||
case "-o-":
|
||||
return "opera";
|
||||
case "-webkit-":
|
||||
return "chrome";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
})();
|
||||
|
||||
// $ExpectError
|
||||
if (browser === "safari") {
|
||||
// There's no way to differentiate Safari from Chrome using just prefixes
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"prefixfree-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"indent": [
|
||||
true,
|
||||
"tabs"
|
||||
]
|
||||
}
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for react-axe 3.1
|
||||
// Project: https://github.com/dequelabs/react-axe
|
||||
// Definitions by: Akshay Karthik <https://github.com/akshaykarthik>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import { Spec } from "axe-core";
|
||||
|
||||
export = axe;
|
||||
|
||||
declare function axe(
|
||||
react: typeof React,
|
||||
reactDOM: typeof ReactDOM,
|
||||
timeout: number,
|
||||
config?: axe.ReactAxeConfig
|
||||
): void;
|
||||
|
||||
declare namespace axe {
|
||||
type ReactAxeConfig = Spec;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axe-core": "3.2.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import * as axe from "react-axe";
|
||||
|
||||
axe(React, ReactDOM, 1000);
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-axe-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user