mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merged branch master into master
This commit is contained in:
@@ -5,6 +5,7 @@ interface TestScope extends ng.IScope {
|
||||
}
|
||||
|
||||
myApp.config((
|
||||
$mdAriaProvider: ng.material.IAriaProvider,
|
||||
$mdThemingProvider: ng.material.IThemingProvider,
|
||||
$mdIconProvider: ng.material.IIconProvider,
|
||||
$mdProgressCircularProvider: ng.material.IProgressCircularProvider) => {
|
||||
@@ -52,6 +53,9 @@ myApp.config((
|
||||
return c * Math.pow(2, (t / d - 1) * 10) + b;
|
||||
}
|
||||
});
|
||||
|
||||
// Globally disables all ARIA warnings.
|
||||
$mdAriaProvider.disableWarnings();
|
||||
});
|
||||
|
||||
myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => {
|
||||
|
||||
Vendored
+5
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for angular-material 1.1
|
||||
// Project: https://github.com/angular/material
|
||||
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>, Davide Donadello <https://github.com/Dona278>, Geert Jansen <https://github.com/geertjansen>
|
||||
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>, Davide Donadello <https://github.com/Dona278>, Geert Jansen <https://github.com/geertjansen>, Edward Knowles <https://github.com/eknowles>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -11,6 +11,10 @@ export = _;
|
||||
|
||||
declare module 'angular' {
|
||||
namespace material {
|
||||
interface IAriaProvider {
|
||||
disableWarnings(): void;
|
||||
}
|
||||
|
||||
interface ResolveObject {
|
||||
[name: string]: Injectable<(...args: any[]) => PromiseLike<any>>;
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import CaseSensitivePathsWebpackPlugin = require('case-sensitive-paths-webpack-plugin');
|
||||
|
||||
const options: CaseSensitivePathsWebpackPlugin.Options = {
|
||||
debug: true,
|
||||
};
|
||||
|
||||
const c: Configuration = {
|
||||
plugins: [
|
||||
new CaseSensitivePathsWebpackPlugin(),
|
||||
new CaseSensitivePathsWebpackPlugin({
|
||||
debug: true
|
||||
}),
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// Type definitions for case-sensitive-paths-webpack-plugin 2.1
|
||||
// Project: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme
|
||||
// Definitions by: Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
export = CaseSensitivePathsWebpackPlugin;
|
||||
|
||||
declare class CaseSensitivePathsWebpackPlugin extends Plugin {
|
||||
constructor(options?: CaseSensitivePathsWebpackPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace CaseSensitivePathsWebpackPlugin {
|
||||
interface Options {
|
||||
/**
|
||||
* Show more information
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"case-sensitive-paths-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+19
-12
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Chart.js 2.6
|
||||
// Type definitions for Chart.js 2.7
|
||||
// Project: https://github.com/nnnick/Chart.js
|
||||
// Definitions by: Alberto Nuti <https://github.com/anuti>
|
||||
// Fabien Lavocat <https://github.com/FabienLavocat>
|
||||
@@ -114,18 +114,25 @@ declare namespace Chart {
|
||||
index?: number;
|
||||
}
|
||||
|
||||
interface ChartTooltipLabelColor {
|
||||
borderColor: ChartColor;
|
||||
backgroundColor: ChartColor;
|
||||
}
|
||||
|
||||
interface ChartTooltipCallback {
|
||||
beforeTitle?(item?: ChartTooltipItem[], data?: any): void;
|
||||
title?(item?: ChartTooltipItem[], data?: any): void;
|
||||
afterTitle?(item?: ChartTooltipItem[], data?: any): void;
|
||||
beforeBody?(item?: ChartTooltipItem[], data?: any): void;
|
||||
beforeLabel?(tooltipItem?: ChartTooltipItem, data?: any): void;
|
||||
label?(tooltipItem?: ChartTooltipItem, data?: any): void;
|
||||
afterLabel?(tooltipItem?: ChartTooltipItem, data?: any): void;
|
||||
afterBody?(item?: ChartTooltipItem[], data?: any): void;
|
||||
beforeFooter?(item?: ChartTooltipItem[], data?: any): void;
|
||||
footer?(item?: ChartTooltipItem[], data?: any): void;
|
||||
afterFooter?(item?: ChartTooltipItem[], data?: any): void;
|
||||
beforeTitle?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
title?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
afterTitle?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
beforeBody?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
beforeLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[];
|
||||
label?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[];
|
||||
labelColor?(tooltipItem: ChartTooltipItem, chart: Chart): ChartTooltipLabelColor;
|
||||
labelTextColor?(tooltipItem: ChartTooltipItem, chart: Chart): string;
|
||||
afterLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[];
|
||||
afterBody?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
beforeFooter?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
footer?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
afterFooter?(item: ChartTooltipItem[], data: ChartData): string | string[];
|
||||
}
|
||||
|
||||
interface ChartAnimationParameter {
|
||||
|
||||
Vendored
+56
-43
@@ -1,4 +1,4 @@
|
||||
// Type definitions for command-line-args 4.0.6
|
||||
// Type definitions for command-line-args 4.0.7
|
||||
// Project: https://github.com/75lb/command-line-args
|
||||
// Definitions by: CzBuCHi <https://github.com/CzBuCHi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -25,50 +25,63 @@
|
||||
*/
|
||||
declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any;
|
||||
|
||||
declare module commandLineArgs {
|
||||
declare module commandLineArgs {
|
||||
|
||||
export interface OptionDefinition {
|
||||
/**
|
||||
* The only required definition property is name, the value of each option will be either a Boolean or string.
|
||||
*/
|
||||
name: string,
|
||||
/**
|
||||
* The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
|
||||
*/
|
||||
type?: (arg: string) => any,
|
||||
/**
|
||||
* getopt-style short option names. Can be any single character (unicode included) except a digit or hypen.
|
||||
*/
|
||||
alias?: string,
|
||||
/**
|
||||
* Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified).
|
||||
*/
|
||||
multiple?: boolean,
|
||||
/**
|
||||
* Any unclaimed command-line args will be set on this option. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. $ myapp *.js instead of $ myapp --files *.js).
|
||||
*/
|
||||
defaultOption?: boolean,
|
||||
/**
|
||||
* An initial value for the option.
|
||||
*/
|
||||
defaultValue?: any,
|
||||
/**
|
||||
* When your app has a large amount of options it makes sense to organise them in groups.
|
||||
* There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition).
|
||||
*/
|
||||
group?: string | string[],
|
||||
}
|
||||
export interface OptionDefinition {
|
||||
/**
|
||||
* The only required definition property is name, the value of each option will be either a Boolean or string.
|
||||
*/
|
||||
name: string,
|
||||
/**
|
||||
* The type value is a setter function (you receive the output from this),
|
||||
* enabling you to be specific about the type and value received.
|
||||
*/
|
||||
type?: (arg: string) => any,
|
||||
/**
|
||||
* getopt-style short option names. Can be any single character (unicode included) except a digit or hypen.
|
||||
*/
|
||||
alias?: string,
|
||||
/**
|
||||
* Set this flag if the option takes a list of values. You will receive an array of values, each passed
|
||||
* through the type function (if specified).
|
||||
*/
|
||||
multiple?: boolean,
|
||||
/**
|
||||
* Any unclaimed command-line args will be set on this option. This flag is typically set on
|
||||
* the most commonly-used option to make for more concise usage
|
||||
* (i.e. $ myapp *.js instead of $ myapp --files *.js).
|
||||
*/
|
||||
defaultOption?: boolean,
|
||||
/**
|
||||
* An initial value for the option.
|
||||
*/
|
||||
defaultValue?: any,
|
||||
/**
|
||||
* When your app has a large amount of options it makes sense to organise them in groups.
|
||||
* There are two automatic groups: _all (contains all options) and _none (contains options
|
||||
* without a group specified in their definition).
|
||||
*/
|
||||
group?: string | string[],
|
||||
/**
|
||||
* Describes the option.
|
||||
*/
|
||||
description?: string,
|
||||
/**
|
||||
* A label for the type, e.g. <ms>.
|
||||
*/
|
||||
typeLabel?: string;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
*/
|
||||
argv?: string[];
|
||||
/**
|
||||
* If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
*/
|
||||
partial?: boolean;
|
||||
}
|
||||
export interface Options {
|
||||
/**
|
||||
* An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
*/
|
||||
argv?: string[];
|
||||
/**
|
||||
* If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
*/
|
||||
partial?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = commandLineArgs;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as enigma from "enigma.js";
|
||||
// import enigma = require("enigma.js");
|
||||
|
||||
const config: enigmaJS.IConfig = {
|
||||
url: "http://127.0.0.1:4848/",
|
||||
schema: {}
|
||||
};
|
||||
enigma.create(config).open().then((global) => {
|
||||
console.log("connect fine");
|
||||
});
|
||||
Vendored
+194
@@ -0,0 +1,194 @@
|
||||
// Type definitions for enigma.js 2.2
|
||||
// Project: https://github.com/qlik-oss/enigma.js/
|
||||
// Definitions by: Konrad Mattheis <https://github.com/konne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare module "enigma.js" {
|
||||
const e: IEnigmaClass;
|
||||
export = e;
|
||||
}
|
||||
|
||||
// declare const enigmaJS: IEnigmaClass;
|
||||
// export = enigmaJS;
|
||||
// export as namespace enigmaJS;
|
||||
|
||||
interface IEnigmaClass {
|
||||
/**
|
||||
* Create a session object.
|
||||
* @returns - Returns a session.
|
||||
* Note: See Configuration for the configuration options.
|
||||
*/
|
||||
create(config: enigmaJS.IConfig): enigmaJS.ISession;
|
||||
}
|
||||
|
||||
declare namespace enigmaJS {
|
||||
type MixinType = "Doc"| "GenericObject"| "GenericBookmark" | string;
|
||||
|
||||
interface IMixin {
|
||||
/**
|
||||
* QIX Engine types like for example GenericObject, Doc, GenericBookmark, are supported but also custom GenericObject
|
||||
* types such as barchart, story and myCustomType.
|
||||
* An API will get both their generic type as well as custom type mixins applied.
|
||||
*/
|
||||
types: MixinType[];
|
||||
|
||||
init(args: {config: any, api: IGeneratedAPI}): void;
|
||||
|
||||
/**
|
||||
* mixin.extend is an object containing methods to extend the generated API with. These method names cannot already exist or enigma.js will throw an error.
|
||||
*/
|
||||
extend?: [any];
|
||||
|
||||
/**
|
||||
* mixin.override is an object containing methods that overrides existing API methods.
|
||||
* These method names needs to exist already* or engima.js will throw an error.
|
||||
* Be careful when overriding, you may break expected behaviors in other mixins or your application.
|
||||
* base is a reference to the previous mixin method, can be used to invoke the mixin chain before this mixin method.
|
||||
*/
|
||||
override?: [any];
|
||||
}
|
||||
|
||||
interface IProtocol {
|
||||
// Set to false to disable the use of the bandwidth-reducing delta protocol.
|
||||
delta?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* This section describes the configuration object that is sent into enigma.create(config).
|
||||
*/
|
||||
interface IConfig {
|
||||
/**
|
||||
* Object containing the specification for the API to generate. Corresponds to a specific version of the QIX Engine API.
|
||||
*/
|
||||
schema: object;
|
||||
/**
|
||||
* String containing a proper websocket URL to QIX Engine.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A function to use when instantiating the WebSocket, mandatory for Node.js.
|
||||
*/
|
||||
createSocket?: any;
|
||||
/**
|
||||
* ES6-compatible Promise library.
|
||||
*/
|
||||
Promise?: any;
|
||||
/**
|
||||
* Set to true if the session should be suspended instead of closed when the websocket is closed.
|
||||
*/
|
||||
suspendOnClose?: boolean;
|
||||
/**
|
||||
* Mixins to extend/augment the QIX Engine API.
|
||||
* See Mixins section for more information how each entry in this array should look like.
|
||||
* Mixins are applied in the array order.
|
||||
*/
|
||||
mixins?: [any];
|
||||
/**
|
||||
* Interceptors for augmenting responses before they are passed into mixins and end-users.
|
||||
* See Interceptors section for more information how each entry in this array should look like.
|
||||
* Interceptors are applied in the array order.
|
||||
*/
|
||||
interceptors?: [any];
|
||||
/**
|
||||
* An object containing additional JSON-RPC request parameters.
|
||||
* protocol.delta : Set to false to disable the use of the bandwidth-reducing delta protocol.
|
||||
*/
|
||||
protocol?: any;
|
||||
}
|
||||
|
||||
interface ISession {
|
||||
/**
|
||||
* Establishes the websocket against the configured URL. Eventually resolved with the QIX global interface when the connection has been established.
|
||||
* @return Promise.
|
||||
*/
|
||||
open<T extends IGeneratedAPI>(): Promise<T>;
|
||||
|
||||
/**
|
||||
* Closes the websocket and cleans up internal caches, also triggers the closed event on all generated APIs.
|
||||
* Eventually resolved when the websocket has been closed.
|
||||
*
|
||||
* Note: you need to manually invoke this when you want to close a session and config.suspendOnClose is true.
|
||||
* @return Promise.
|
||||
*/
|
||||
close(): Promise<any>;
|
||||
|
||||
/**
|
||||
* Suspends the enigma.js session by closing the websocket and rejecting all method calls until it has been resumed again.
|
||||
* @return Promise.
|
||||
*/
|
||||
suspend(): Promise<any>;
|
||||
|
||||
/**
|
||||
* Resume a previously suspended enigma.js session by re-creating the websocket and, if possible, re-open the document
|
||||
* as well as refreshing the internal caches. If successful, changed events will be triggered on all generated APIs,
|
||||
* and on the ones it was unable to restore, the closed event will be triggered.
|
||||
* @param onlyIfAttached onlyIfAttached can be used to only allow resuming if the QIX Engine session was reattached properly.
|
||||
* @return Promise.
|
||||
* Note: Eventually resolved when the websocket (and potentially the previously opened document, and generated APIs) has been restored,
|
||||
* rejected when it fails any of those steps, or when onlyIfAttached is true and a new QIX Engine session was created.
|
||||
*/
|
||||
resume(onlyIfAttached?: boolean): Promise<any>;
|
||||
|
||||
/**
|
||||
* Handle opened state. This event is triggered whenever the websocket is connected and ready for communication.
|
||||
*
|
||||
* Handle closed state. This event is triggered when the underlying websocket is closed and config.suspendOnClose is false.
|
||||
*
|
||||
* Handle suspended state. This event is triggered in two cases (listed below). It is useful in scenarios where you for example
|
||||
* want to block interaction in your application until you are resumed again.
|
||||
* If config.suspendOnClose is true and there was a network disconnect (socked closed)
|
||||
* If you ran session.suspend()
|
||||
* The evt.initiator value is a string indicating what triggered the suspended state. Possible values: network, manual.
|
||||
*
|
||||
* Handle resumed state. This event is triggered when the session was properly resumed.
|
||||
* It is useful in scenarios where you for example can close blocking modal dialogs and allow the user to interact with your application again.
|
||||
*
|
||||
* notification:*
|
||||
* @param event - Event that triggers the function
|
||||
* @param func - Called function
|
||||
*/
|
||||
on(event: "opened" | "close" | "suspended" | "resumed" | string, func: any): void;
|
||||
}
|
||||
|
||||
interface IGeneratedAPI {
|
||||
/**
|
||||
* This property contains the unique identifier for this API.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* This property contains the schema class name for this API.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* Despite the name, this property corresponds to the qInfo.qType property on your generic object's properties object.
|
||||
*/
|
||||
genericType: string;
|
||||
|
||||
/**
|
||||
* This property contains a reference to the session that this API belongs to.
|
||||
*/
|
||||
session: ISession;
|
||||
|
||||
/**
|
||||
* This property contains the handle QIX Engine assigned to the API.
|
||||
* Used internally in enigma.js for caches and JSON-RPC
|
||||
*/
|
||||
handle: number;
|
||||
|
||||
/**
|
||||
* register a function for events
|
||||
* @param event - function called if this event occures
|
||||
* @param func - function that is called
|
||||
*/
|
||||
on(event: "changed" | "closed", func: () => void): void;
|
||||
|
||||
/**
|
||||
* manual emit an events
|
||||
* @param event - event that occures
|
||||
*/
|
||||
emit(event: "changed" | "closed"): void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"enigma.js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"ban-types": false,
|
||||
"no-empty-interface": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-declare-current-package": false,
|
||||
"interface-name": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import hexToRgba = require('hex-rgba');
|
||||
|
||||
const rgba = hexToRgba('#1b2b34', 40);
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for hex-rgba 1.0
|
||||
// Project: https://github.com/developersoul/hex-rgba#readme
|
||||
// Definitions by: Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = hexToRgba;
|
||||
|
||||
declare function hexToRgba(hex: string, opacity: number): string;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hex-rgba-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -4,7 +4,7 @@ import q = require('q');
|
||||
var commandFactory = hystrixjs.commandFactory;
|
||||
|
||||
var command = commandFactory
|
||||
.getOrCreate('testCommand', 'testGroup')
|
||||
.getOrCreate<string, string>('testCommand', 'testGroup')
|
||||
.circuitBreakerSleepWindowInMilliseconds(5000)
|
||||
.errorHandler((error) => {
|
||||
return false;
|
||||
|
||||
Vendored
+199
-7
@@ -4,7 +4,6 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Q from "q";
|
||||
import * as RX from "rx";
|
||||
|
||||
export as namespace hystrixjs;
|
||||
@@ -23,7 +22,8 @@ export interface HystrixProperties {
|
||||
"hystrix.metrics.statistical.window.bucketsNumber"?: number,
|
||||
"hystrix.metrics.percentile.window.timeInMilliseconds"?: number,
|
||||
"hystrix.metrics.percentile.window.bucketsNumber"?: number,
|
||||
"hystrix.request.volume.rejectionThreshold"?: number
|
||||
"hystrix.request.volume.rejectionThreshold"?: number,
|
||||
"hystrix.promise.implementation"?: PromiseConstructorLike,
|
||||
}
|
||||
|
||||
export interface HystrixConfig {
|
||||
@@ -46,7 +46,39 @@ export interface HystrixConfig {
|
||||
}
|
||||
|
||||
export interface Command {
|
||||
execute(...args: any[]): Q.Promise<any>;
|
||||
execute(...args: any[]): PromiseLike<any>
|
||||
}
|
||||
|
||||
export interface CommandA0<R> {
|
||||
execute<R>(): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA1<R, T> {
|
||||
execute(t: T): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA2<R, T, U> {
|
||||
execute(t: T, u: U): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA3<R, T, U, V> {
|
||||
execute(t: T, u: U, v: V): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA4<R, T, U, V, W> {
|
||||
execute(t: T, u: U, v: V, w: W): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA5<R, T, U, V, W, X> {
|
||||
execute(t: T, u: U, v: V, w: W, x: X): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA6<R, T, U, V, W, X, Y> {
|
||||
execute(t: T, u: U, v: V, w: W, x: X, y: Y): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandA7<R, T, U, V, W, X, Y, Z> {
|
||||
execute(t: T, u: U, v: V, w: W, x: X, y: Y, z: Z): PromiseLike<R>
|
||||
}
|
||||
|
||||
export interface CommandBuilder {
|
||||
@@ -62,14 +94,174 @@ export interface CommandBuilder {
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilder;
|
||||
percentileWindowLength(value: number): CommandBuilder;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilder;
|
||||
run(value: (args: any) => Q.Promise<any>): CommandBuilder;
|
||||
fallbackTo(value: (...args: any[]) => Q.Promise<any>): CommandBuilder;
|
||||
context(value: any): CommandBuilder;
|
||||
build(): Command;
|
||||
run(value: (...args: any[]) => PromiseLike<any>): CommandBuilder;
|
||||
fallbackTo(value: (error: Error, args ?: any[]) => PromiseLike<any>): CommandBuilder;
|
||||
build() : Command;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA0<R> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA0<R>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA0<R>;
|
||||
timeout(value: number): CommandBuilderA0<R>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA0<R>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA0<R>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA0<R>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA0<R>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA0<R>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA0<R>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA0<R>;
|
||||
percentileWindowLength(value: number): CommandBuilderA0<R>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA0<R>;
|
||||
context(value: any): CommandBuilderA0<R>;
|
||||
run(value: () => PromiseLike<R>): CommandBuilderA0<R>;
|
||||
fallbackTo(value: (error: Error) => PromiseLike<R>): CommandBuilderA0<R>;
|
||||
build() : CommandA0<R>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA1<R, T> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA1<R, T>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA1<R, T>;
|
||||
timeout(value: number): CommandBuilderA1<R, T>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA1<R, T>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA1<R, T>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA1<R, T>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA1<R, T>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA1<R, T>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA1<R, T>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA1<R, T>;
|
||||
percentileWindowLength(value: number): CommandBuilderA1<R, T>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA1<R, T>;
|
||||
context(value: any): CommandBuilderA1<R, T>;
|
||||
run(value: (t: T) => PromiseLike<R>): CommandBuilderA1<R, T>;
|
||||
fallbackTo(value: (error: Error, args : [T]) => PromiseLike<R>): CommandBuilderA1<R, T>;
|
||||
build(): CommandA1<R, T>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA2<R, T, U> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA2<R, T, U>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA2<R, T, U>;
|
||||
timeout(value: number): CommandBuilderA2<R, T, U>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA2<R, T, U>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA2<R, T, U>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA2<R, T, U>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA2<R, T, U>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA2<R, T, U>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA2<R, T, U>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA2<R, T, U>;
|
||||
percentileWindowLength(value: number): CommandBuilderA2<R, T, U>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA2<R, T, U>;
|
||||
context(value: any): CommandBuilderA2<R, T, U>;
|
||||
run(value: (t: T, u: U) => PromiseLike<R>): CommandBuilderA2<R, T, U>;
|
||||
fallbackTo(value: (error: Error, args: [T, U]) => PromiseLike<R>): CommandBuilderA2<R, T, U>;
|
||||
build(): CommandA2<R, T, U>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA3<R, T, U, V> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA3<R, T, U, V>;
|
||||
timeout(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA3<R, T, U, V>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA3<R, T, U, V>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
percentileWindowLength(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA3<R, T, U, V>;
|
||||
context(value: any): CommandBuilderA3<R, T, U, V>;
|
||||
run(value: (t: T, u: U, v: V) => PromiseLike<R>): CommandBuilderA3<R, T, U, V>;
|
||||
fallbackTo(value: (error: Error, args: [T, U, V]) => PromiseLike<R>): CommandBuilderA3<R, T, U, V>;
|
||||
build(): CommandA3<R, T, U, V>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA4<R, T, U, V, W> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA4<R, T, U, V, W>;
|
||||
timeout(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA4<R, T, U, V, W>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA4<R, T, U, V, W>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
percentileWindowLength(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA4<R, T, U, V, W>;
|
||||
context(value: any): CommandBuilderA4<R, T, U, V, W>;
|
||||
run(value: (t: T, u: U, v: V, w: W) => PromiseLike<R>): CommandBuilderA4<R, T, U, V, W>;
|
||||
fallbackTo(value: (error: Error, args: [T, U, V, W]) => PromiseLike<R>): CommandBuilderA4<R, T, U, V, W>;
|
||||
build(): CommandA4<R, T, U, V, W>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA5<R, T, U, V, W, X> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
timeout(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
percentileWindowLength(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
context(value: any): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
run(value: (t: T, u: U, v: V, w: W, x: X) => PromiseLike<R>): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
fallbackTo(value: (error: Error, args: [T, U, V, W, X]) => PromiseLike<R>): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
build(): CommandA5<R, T, U, V, W, X>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA6<R, T, U, V, W, X, Y> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
timeout(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
percentileWindowLength(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
context(value: any): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
run(value: (t: T, u: U, v: V, w: W, x: X, y: Y) => PromiseLike<R>): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
fallbackTo(value: (error: Error, args: [T, U, V, W, X, Y]) => PromiseLike<R>): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
build(): CommandA6<R, T, U, V, W, X, Y>;
|
||||
}
|
||||
|
||||
export interface CommandBuilderA7<R, T, U, V, W, X, Y, Z> {
|
||||
circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
errorHandler(value: (error: any) => boolean): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
timeout(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
requestVolumeRejectionThreshold(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
circuitBreakerForceOpened(value: boolean): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
circuitBreakerForceClosed(value: boolean): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
statisticalWindowNumberOfBuckets(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
statisticalWindowLength(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
percentileWindowNumberOfBuckets(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
percentileWindowLength(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
context(value: any): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
run(value: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z) => PromiseLike<R>): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
fallbackTo(value: (error: Error, args: [T, U, V, W, X, Y, Z]) => PromiseLike<R>): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
build(): CommandA7<R, T, U, V, W, X, Y, Z>;
|
||||
}
|
||||
|
||||
export interface CommandFactory {
|
||||
getOrCreate(commandKey: string, commandGroup?: string): CommandBuilder;
|
||||
getOrCreate<R>(commandKey: string, commandGroup?: string): CommandBuilderA0<R>;
|
||||
getOrCreate<R, T>(commandKey: string, commandGroup?: string): CommandBuilderA1<R, T>;
|
||||
getOrCreate<R, T, U>(commandKey: string, commandGroup?: string): CommandBuilderA2<R, T, U>;
|
||||
getOrCreate<R, T, U, V>(commandKey: string, commandGroup?: string): CommandBuilderA3<R, T, U, V>;
|
||||
getOrCreate<R, T, U, V, W>(commandKey: string, commandGroup?: string): CommandBuilderA4<R, T, U, V, W>;
|
||||
getOrCreate<R, T, U, V, W, X>(commandKey: string, commandGroup?: string): CommandBuilderA5<R, T, U, V, W, X>;
|
||||
getOrCreate<R, T, U, V, W, X, Y>(commandKey: string, commandGroup?: string): CommandBuilderA6<R, T, U, V, W, X, Y>;
|
||||
getOrCreate<R, T, U, V, W, X, Y, Z>(commandKey: string, commandGroup?: string): CommandBuilderA7<R, T, U, V, W, X, Y, Z>;
|
||||
resetCache(): void;
|
||||
}
|
||||
|
||||
@@ -141,4 +333,4 @@ export var commandFactory: CommandFactory;
|
||||
export var metricsFactory: MetricsFactory;
|
||||
export var circuitFactory: CircuitFactory;
|
||||
export var hystrixSSEStream: HystrixSSEStream;
|
||||
export var hystrixConfig: HystrixConfig;
|
||||
export var hystrixConfig: HystrixConfig;
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"q": [
|
||||
"q/v0"
|
||||
]
|
||||
},
|
||||
"paths": {},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
@@ -26,4 +22,4 @@
|
||||
"index.d.ts",
|
||||
"hystrixjs-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+7
-2
@@ -3,6 +3,7 @@
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Christopher Eck <https://github.com/chrisleck>
|
||||
// Yoga Aliarham <https://github.com/aliarham11>
|
||||
// Ebrahim <https://github.com/br8h>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
@@ -344,8 +345,8 @@ declare namespace IORedis {
|
||||
type(key: string, callback: (err: Error, res: string) => void): void;
|
||||
type(key: string): Promise<string>;
|
||||
|
||||
multi(callback: (err: Error, res: string) => void): void;
|
||||
multi(): Promise<string>;
|
||||
multi(commands?: string[][], options?: MultiOptions): Pipeline;
|
||||
multi(options: { pipeline: false }): Promise<string>;
|
||||
|
||||
exec(callback: (err: Error, res: any) => void): void;
|
||||
exec(): Promise<any>;
|
||||
@@ -844,4 +845,8 @@ declare namespace IORedis {
|
||||
retryDelayOnTryAgain?: number;
|
||||
redisOptions?: RedisOptions;
|
||||
}
|
||||
|
||||
interface MultiOptions {
|
||||
pipeline: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,3 +90,17 @@ Redis.Command.setArgumentTransformer('set', args => {
|
||||
Redis.Command.setReplyTransformer('get', (result: any) => {
|
||||
return result;
|
||||
});
|
||||
|
||||
// multi
|
||||
redis.multi().set('foo', 'bar').set('foo', 'baz').get('foo', (err, result) => {
|
||||
// result === 'QUEUED'
|
||||
}).exec((err, results) => {
|
||||
// results = [[null, 'OK'], [null, 'OK'], [null, 'baz']]
|
||||
});
|
||||
|
||||
redis.multi([
|
||||
['set', 'foo', 'bar'],
|
||||
['get', 'foo']
|
||||
]).exec((err, results) => {
|
||||
// results = [[null, 'OK'], [null, 'bar']]
|
||||
});
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for otplib 7.0
|
||||
// Project: https://yeojz.github.io/otplib
|
||||
// Definitions by: Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export namespace authenticator {
|
||||
interface VerifyOptions {
|
||||
token: string;
|
||||
secret: string;
|
||||
}
|
||||
|
||||
function generateSecret(): string;
|
||||
|
||||
function generate(secret: string): string;
|
||||
|
||||
function check(token: string, secret: string): boolean;
|
||||
|
||||
function verify(options: VerifyOptions): boolean;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as otplib from "otplib";
|
||||
|
||||
const secretValue = otplib.authenticator.generateSecret();
|
||||
const tokenValue = otplib.authenticator.generate(secretValue);
|
||||
|
||||
let isValid = otplib.authenticator.check(tokenValue, secretValue);
|
||||
isValid = otplib.authenticator.verify({secret: secretValue, token: tokenValue});
|
||||
@@ -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",
|
||||
"otplib-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for package-json 4.0
|
||||
// Project: https://github.com/sindresorhus/package-json#readme
|
||||
// Definitions by: Jinwoo Lee <https://github.com/jinwoo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface PackageJsonOptions {
|
||||
version?: string;
|
||||
fullMetadata?: boolean;
|
||||
allVersions?: boolean;
|
||||
}
|
||||
|
||||
declare function packageJson(name: string, options?: PackageJsonOptions): Promise<{}>;
|
||||
|
||||
export = packageJson;
|
||||
@@ -0,0 +1,10 @@
|
||||
import packageJson = require('package-json');
|
||||
|
||||
let pkg: {};
|
||||
packageJson('package-json', {
|
||||
version: '1.2.3',
|
||||
fullMetadata: true,
|
||||
allVersions: true,
|
||||
}).then(x => {
|
||||
pkg = x;
|
||||
});
|
||||
@@ -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",
|
||||
"package-json-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+11
-27
@@ -5070,32 +5070,11 @@ declare namespace EngineAPI {
|
||||
qAttrDims?: INxAttributeDimValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* ImplementOn...
|
||||
*/
|
||||
interface IImplementOn {
|
||||
/**
|
||||
* register a function for events
|
||||
* @param event - function called if this event occures
|
||||
* @param func - function that is called
|
||||
*/
|
||||
on(event: "changed" | "closed", func: () => void): void;
|
||||
|
||||
/**
|
||||
* manual emit an events
|
||||
* @param event - event that occures
|
||||
*/
|
||||
emit(event: "changed" | "closed"): void;
|
||||
|
||||
// ? not in Docu
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class describes all the methods that apply at generic object level.
|
||||
* The handle member in the JSON request for all methods listed in this section is the handle of the generic object.
|
||||
*/
|
||||
interface IGenericObject extends IImplementOn {
|
||||
interface IGenericObject extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* app describes all the methods that apply at app level.
|
||||
*/
|
||||
@@ -6010,7 +5989,7 @@ declare namespace EngineAPI {
|
||||
interface IGenericDerivedFieldProperties extends IGenericProperties {
|
||||
}
|
||||
|
||||
interface IGenericDerivedFields extends IImplementOn {
|
||||
interface IGenericDerivedFields extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* Shows the properties of an object.
|
||||
* Returns the identifier and the definition of the derived field.
|
||||
@@ -6054,7 +6033,7 @@ declare namespace EngineAPI {
|
||||
* This class describes all the methods that apply at measure level.
|
||||
* The handle member in the JSON request for all methods listed in this section is the handle of the measure.
|
||||
*/
|
||||
interface IGenericMeasure extends IImplementOn {
|
||||
interface IGenericMeasure extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* Applies a patch to the properties of an object. Allows an update to some of the properties.
|
||||
*
|
||||
@@ -6122,7 +6101,7 @@ declare namespace EngineAPI {
|
||||
* This class describes all the methods that apply at generic variable level.
|
||||
* The handle member in the JSON request for all methods listed in this section is the handle of the generic variable.
|
||||
*/
|
||||
interface IGenericVariable extends IImplementOn {
|
||||
interface IGenericVariable extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* Applies a patch to the properties of a variable. Allows an update to some of the properties.
|
||||
*
|
||||
@@ -6245,7 +6224,7 @@ declare namespace EngineAPI {
|
||||
*
|
||||
* The handle member in the JSON request for all methods listed in this section is the handle of the variable.
|
||||
*/
|
||||
interface IVariable extends IImplementOn {
|
||||
interface IVariable extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* Sets the value of a dual variable overriding any input constraints.
|
||||
*
|
||||
@@ -6926,7 +6905,7 @@ declare namespace EngineAPI {
|
||||
* This class describes all the methods that apply at global level.
|
||||
* The handle member in the JSON request for all methods listed in this section is -1.
|
||||
*/
|
||||
interface IGlobal {
|
||||
interface IGlobal extends enigmaJS.IGeneratedAPI {
|
||||
/**
|
||||
* Sets an abort flag on all pending and ongoing requests in the current engine session.
|
||||
* If an abort flag is set on a pending request, the request is aborted.
|
||||
@@ -9700,3 +9679,8 @@ declare namespace EngineAPI {
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
declare namespace enigmaJS {
|
||||
interface IGeneratedAPI {
|
||||
}
|
||||
}
|
||||
|
||||
+42
@@ -2565,3 +2565,45 @@ declare module "qvangular" {
|
||||
const e: IQVAngular;
|
||||
export = e;
|
||||
}
|
||||
|
||||
/**
|
||||
* This section is added because the Qlik Sense Client after > 3.2 contains a engineapi
|
||||
* an this makes the handling more fluent for users of that files.
|
||||
*/
|
||||
declare namespace enigmaJS {
|
||||
interface IGeneratedAPI {
|
||||
/**
|
||||
* This property contains the unique identifier for this API.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* This property contains the schema class name for this API.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* Despite the name, this property corresponds to the qInfo.qType property on your generic object's properties object.
|
||||
*/
|
||||
genericType: string;
|
||||
|
||||
/**
|
||||
* This property contains the handle QIX Engine assigned to the API.
|
||||
* Used internally in enigma.js for caches and JSON-RPC
|
||||
*/
|
||||
handle: number;
|
||||
|
||||
/**
|
||||
* register a function for events
|
||||
* @param event - function called if this event occures
|
||||
* @param func - function that is called
|
||||
*/
|
||||
on(event: "changed" | "closed", func: () => void): void;
|
||||
|
||||
/**
|
||||
* manual emit an events
|
||||
* @param event - event that occures
|
||||
*/
|
||||
emit(event: "changed" | "closed"): void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -418,7 +418,7 @@ declare namespace __ReactMDL {
|
||||
hideSpacer?: boolean;
|
||||
}
|
||||
interface HeaderRowProps extends __MDLOtherProps {
|
||||
title?: string;
|
||||
title?: any; // string | JSX.Element
|
||||
hideSpacer?: boolean;
|
||||
}
|
||||
interface HeaderTabsProps extends __MDLOtherProps, RippleComponent {
|
||||
|
||||
+9
-1
@@ -1,16 +1,20 @@
|
||||
// Type definitions for react-native-datepicker 1.4
|
||||
// Type definitions for react-native-datepicker 1.6
|
||||
// Project: https://github.com/xgfe/react-native-datepicker
|
||||
// Definitions by: Jacob Baskin <https://github.com/jacobbaskin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from 'react';
|
||||
import { ImageURISource } from 'react-native';
|
||||
|
||||
export interface DatePickerProps {
|
||||
mode?: 'date' | 'datetime' | 'time';
|
||||
androidMode?: 'default' | 'calendar' | 'spinner';
|
||||
date?: string | Date;
|
||||
format?: string;
|
||||
iconSource?: ImageURISource;
|
||||
iconComponent?: JSX.Element;
|
||||
hideText?: boolean;
|
||||
minDate?: string | Date;
|
||||
maxDate?: string | Date;
|
||||
height?: number;
|
||||
@@ -20,12 +24,16 @@ export interface DatePickerProps {
|
||||
showIcon?: boolean;
|
||||
disabled?: boolean;
|
||||
onDateChange?(dateStr: string, date: Date): void;
|
||||
onOpenModal?: () => void;
|
||||
onCloseModal?: () => void;
|
||||
onPressMask?: () => void;
|
||||
placeholder?: string;
|
||||
modalOnResponderTerminationRequest?(e: any): boolean;
|
||||
is24Hour?: boolean;
|
||||
style?: any;
|
||||
customStyles?: any;
|
||||
minuteInterval?: number;
|
||||
TouchableComponent?: React.Component;
|
||||
}
|
||||
|
||||
declare class DatePicker extends React.Component<DatePickerProps> {
|
||||
|
||||
Vendored
+58
-12
@@ -1,4 +1,4 @@
|
||||
// Type definitions for React OnSenui (react-onsenui) 2.1
|
||||
// Type definitions for React OnSenui (react-onsenui) 2.7
|
||||
// Project: https://onsen.io/v2/docs/guide/react/
|
||||
// Definitions by: Ozytis <https://ozytis.fr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -48,7 +48,9 @@ export class Splitter extends Component { }
|
||||
|
||||
/*** toolbar ***/
|
||||
|
||||
export class Toolbar extends Component {}
|
||||
export class Toolbar extends Component<{
|
||||
modifier?: string
|
||||
}, any> {}
|
||||
|
||||
export class BottomToolbar extends Component<{
|
||||
modifier?: string
|
||||
@@ -57,7 +59,7 @@ export class BottomToolbar extends Component<{
|
||||
export class ToolbarButton extends Component<{
|
||||
modifier?: string,
|
||||
disabled?: boolean,
|
||||
onClick?(e?: Event): void
|
||||
onClick?(e?: React.MouseEvent<HTMLElement>): void
|
||||
}, any> {}
|
||||
|
||||
/*** icon ***/
|
||||
@@ -101,7 +103,7 @@ export class BackButton extends Component<{
|
||||
}, any> {}
|
||||
|
||||
export class Navigator extends Component<{
|
||||
renderPage(route: any, navigator: Navigator): JSX.Element,
|
||||
renderPage(route: any): JSX.Element,
|
||||
initialRouteStack?: string[],
|
||||
initialRoute?: any,
|
||||
onPrePush?(): void,
|
||||
@@ -109,8 +111,10 @@ export class Navigator extends Component<{
|
||||
onPrePop?(): void,
|
||||
onPostPop?(): void,
|
||||
animation?: "slide" | "lift" | "fade" | "none" | string,
|
||||
animationOptions?: AnimationOptions
|
||||
animationOptions?: AnimationOptions,
|
||||
}, any> {
|
||||
pages: any[];
|
||||
routes: any[];
|
||||
resetPage(route: any, options?: any): void;
|
||||
resetPageStack(route: any, options?: any): void;
|
||||
pushPage(route: any, options?: any): void;
|
||||
@@ -196,6 +200,29 @@ export class Popover extends Component<{
|
||||
onPostHide?(): void,
|
||||
}, any> {}
|
||||
|
||||
export class ActionSheet extends Component<{
|
||||
onCancel?(): void,
|
||||
isOpen?: boolean,
|
||||
isCancelable?: boolean,
|
||||
isDisabled?: boolean,
|
||||
animation?: string,
|
||||
modifier?: string
|
||||
maskColor?: string,
|
||||
animationOptions?: {},
|
||||
title?: string
|
||||
onPreShow?(): void,
|
||||
onPostShow?(): void,
|
||||
onPreHide?(): void,
|
||||
onPostHide?(): void,
|
||||
onDeviceBackButton?(): void
|
||||
}, any> {}
|
||||
|
||||
export class ActionSheetButton extends Component<{
|
||||
modifier?: string,
|
||||
icon?: string,
|
||||
onClick?(e?: React.MouseEvent<HTMLElement>): void
|
||||
}, any> {}
|
||||
|
||||
export class ProgressBar extends Component<{
|
||||
modifier?: string,
|
||||
value?: number,
|
||||
@@ -222,20 +249,21 @@ export class Fab extends Component<{
|
||||
ripple?: boolean,
|
||||
position?: string,
|
||||
disabled?: boolean,
|
||||
onClick?: React.MouseEventHandler<HTMLButtonElement>,
|
||||
onClick?(e?: React.MouseEvent<HTMLElement>): void,
|
||||
}, any> {}
|
||||
|
||||
export class Button extends Component<{
|
||||
modifier?: string,
|
||||
disabled?: boolean,
|
||||
ripple?: boolean,
|
||||
onClick?: React.MouseEventHandler<HTMLButtonElement>,
|
||||
className?: string,
|
||||
onClick?(e?: React.MouseEvent<HTMLElement>): void
|
||||
}, any> {}
|
||||
|
||||
export class Input extends Component<{
|
||||
modifier?: string,
|
||||
disabled?: boolean,
|
||||
onChange?: React.ChangeEventHandler<HTMLInputElement>,
|
||||
onChange?: (e: React.ChangeEvent<any>) => void,
|
||||
value?: string,
|
||||
checked?: boolean,
|
||||
placeholder?: string,
|
||||
@@ -243,18 +271,36 @@ export class Input extends Component<{
|
||||
inputId?: string,
|
||||
float?: boolean,
|
||||
name?: string,
|
||||
className?: string
|
||||
}, any> {}
|
||||
|
||||
export class Radio extends Component<{
|
||||
modifier?: string,
|
||||
disabled?: boolean,
|
||||
onChange?(e: Event): void,
|
||||
value?: string,
|
||||
checked?: boolean,
|
||||
inputId?: string
|
||||
}, any> {}
|
||||
|
||||
export class Checkbox extends Component<{
|
||||
modifier?: string,
|
||||
disabled?: boolean,
|
||||
onChange?(e: Event): void,
|
||||
value?: string,
|
||||
checked?: boolean,
|
||||
inputId?: string
|
||||
}, any> {}
|
||||
|
||||
export class Range extends Component<{
|
||||
modifier?: string,
|
||||
onChange?: React.ChangeEventHandler<HTMLInputElement>,
|
||||
onChange?(e: Event): void,
|
||||
value?: number,
|
||||
disabled?: boolean,
|
||||
}, any> {}
|
||||
|
||||
export class Switch extends Component<{
|
||||
modifier?: string,
|
||||
onChange?: React.ChangeEventHandler<HTMLInputElement>,
|
||||
onChange?(e: Event): void,
|
||||
checked?: boolean,
|
||||
disabled?: boolean,
|
||||
inputId?: string
|
||||
@@ -309,7 +355,7 @@ export class ListItem extends Component<{
|
||||
tappable?: boolean,
|
||||
tapBackgroundColor?: string,
|
||||
lockOnDrag?: boolean,
|
||||
onClick?: React.MouseEventHandler<HTMLUListElement>,
|
||||
onClick?: React.MouseEventHandler<any>,
|
||||
}, any> {}
|
||||
|
||||
export class Card extends Component { }
|
||||
|
||||
@@ -21,6 +21,9 @@ export class App extends React.Component<AppProps, AppState> {
|
||||
this.setState({ isOpen: false });
|
||||
}
|
||||
|
||||
onChange(event: React.ChangeEvent<HTMLInputElement>) {}
|
||||
onClick(event: React.MouseEvent<HTMLButtonElement>) {}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Splitter>
|
||||
@@ -37,8 +40,8 @@ export class App extends React.Component<AppProps, AppState> {
|
||||
<SplitterContent>
|
||||
<Page>
|
||||
Test page
|
||||
<Input name='test' type='text' value='test' onChange={onChange} />
|
||||
<Button onClick={onClick} />
|
||||
<Input name='test' type='text' value='test' onChange={this.onChange} />
|
||||
<Button onClick={this.onClick} />
|
||||
</Page>
|
||||
</SplitterContent>
|
||||
</Splitter>
|
||||
@@ -47,6 +50,3 @@ export class App extends React.Component<AppProps, AppState> {
|
||||
}
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('react-body'));
|
||||
|
||||
function onChange(event: React.ChangeEvent<HTMLInputElement>) { }
|
||||
function onClick(event: React.MouseEvent<HTMLButtonElement>) { }
|
||||
|
||||
Vendored
+1
@@ -2656,6 +2656,7 @@ declare namespace React {
|
||||
|
||||
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
||||
span?: number;
|
||||
width?: number | string;
|
||||
}
|
||||
|
||||
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
||||
|
||||
Vendored
+1
-1
@@ -94,7 +94,7 @@ declare namespace resourcejs {
|
||||
interface Resource {
|
||||
status: number;
|
||||
error: Error;
|
||||
item: mongoose.Document | mongoose.Document[];
|
||||
item: any;
|
||||
}
|
||||
|
||||
interface Error {
|
||||
|
||||
@@ -11,7 +11,17 @@ const model = mongoose.model(resourceName, schema);
|
||||
|
||||
resourcejs(app, route, resourceName, model)
|
||||
.get()
|
||||
.post()
|
||||
.post({
|
||||
after(req: resourcejs.Request, res: resourcejs.Response, next: express.NextFunction) {
|
||||
res.resource.item = {
|
||||
foo: "foo",
|
||||
bar: "bar",
|
||||
baz: "baz",
|
||||
};
|
||||
|
||||
next();
|
||||
},
|
||||
})
|
||||
.delete()
|
||||
.put()
|
||||
.patch()
|
||||
|
||||
Vendored
+34
-22
@@ -1,6 +1,6 @@
|
||||
// Type definitions for rollup 0.41
|
||||
// Type definitions for rollup 0.51
|
||||
// Project: https://github.com/rollup/rollup
|
||||
// Definitions by: Philipp A. <https://github.com/flying-sheep>
|
||||
// Definitions by: Philipp A. <https://github.com/flying-sheep>, Christian Svensson <https://github.com/csvn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { RawSourceMap } from 'source-map'
|
||||
@@ -23,15 +23,20 @@ export interface Warning {
|
||||
|
||||
export interface BundleOptions {
|
||||
/** The format of the generated bundle. */
|
||||
format?: Format
|
||||
format: Format
|
||||
/** What export mode to use. Defaults to auto, which guesses your intentions based on what the `entry` module exports. */
|
||||
exports?: 'auto' | 'default' | 'named' | 'none'
|
||||
/** An ID to use for AMD/UMD bundles. */
|
||||
moduleId?: string
|
||||
/** The name to use for the module for UMD/IIFE bundles (required for bundles with exports). */
|
||||
moduleName?: string
|
||||
name?: string
|
||||
/** Mapping of IDs → global variable names. Used for UMD/IIFE bundles. */
|
||||
globals?: { [id: string]: string }
|
||||
/**
|
||||
* Function that takes an ID and returns a path, or Object of id: path pairs.
|
||||
* Where supplied, these paths will be used in the generated bundle instead of the module ID, allowing you to (for example) load dependencies from a CDN.
|
||||
*/
|
||||
paths?: ((id: string) => string) | { [id: string]: string }
|
||||
/**
|
||||
* The indent string to use, for formats that require code to be indented (AMD, IIFE, UMD).
|
||||
* Can also be false (no indent), or true (the default – auto-indent)
|
||||
@@ -55,38 +60,38 @@ export interface BundleOptions {
|
||||
* Whether to include the 'use strict' pragma at the top of generated non-ES6 bundles.
|
||||
* Strictly-speaking (geddit?), ES6 modules are always in strict mode, so you shouldn't disable this without good reason.
|
||||
*/
|
||||
useStrict?: boolean
|
||||
strict?: boolean
|
||||
}
|
||||
|
||||
export interface GenerateOptions extends BundleOptions {
|
||||
/** Whether to generate a sourcemap. If true, the return value from `bundle.generate(...)` will include a map property */
|
||||
sourceMap?: boolean
|
||||
sourcemap?: boolean
|
||||
/**
|
||||
* The location of the generated bundle. If this is an absolute path, all the sources paths in the sourcemap will be relative to it.
|
||||
* The map.file property is the basename of sourceMapFile, as the location of the sourcemap is assumed to be adjacent to the bundle.
|
||||
* The map.file property is the basename of sourcemapFile, as the location of the sourcemap is assumed to be adjacent to the bundle.
|
||||
*/
|
||||
sourceMapFile?: string
|
||||
sourcemapFile?: string
|
||||
}
|
||||
|
||||
export interface WriteOptions extends BundleOptions {
|
||||
/** The file to write to. If `options.sourceMap === true`, two files will be created – `dest` and `dest + '.map`. */
|
||||
dest: string
|
||||
/** If `true`, a separate sourcemap file will be created. If `'inline'`, the sourcemap will be appended to the resulting dest file as a data URI. */
|
||||
sourceMap?: boolean | 'inline'
|
||||
/** This option is unnecessary, as it defaults to the value of dest. */
|
||||
sourceMapFile?: string
|
||||
/** The file to write to. If `options.sourcemap === true`, two files will be created – `file` and `file + '.map`. */
|
||||
file: string
|
||||
/** If `true`, a separate sourcemap file will be created. If `'inline'`, the sourcemap will be appended to the resulting file as a data URI. */
|
||||
sourcemap?: boolean | 'inline'
|
||||
/** This option is unnecessary, as it defaults to the value of file. */
|
||||
sourcemapFile?: string
|
||||
}
|
||||
|
||||
export interface Bundle {
|
||||
/** Generate bundled code as an object */
|
||||
generate(options: GenerateOptions): { code: string, map: SourceMap }
|
||||
generate(options: GenerateOptions): Promise<{ code: string, map: SourceMap | null }>
|
||||
/** writes the file (and accompanying sourcemap file, if appropriate) to the file system. */
|
||||
write(options: WriteOptions): Promise<void>
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/** The bundle's entry point (e.g. your `main.js` or `app.js` or `index.js`) */
|
||||
entry: string | string[]
|
||||
input: string
|
||||
/** A previous bundle. Use it to speed up subsequent bundles :) */
|
||||
cache?: Bundle
|
||||
/**
|
||||
@@ -94,11 +99,6 @@ export interface Options {
|
||||
* The IDs should be either the name of an external dependency or a resolved ID (like an absolute path to a file)
|
||||
*/
|
||||
external?: ((id: string) => boolean) | string[]
|
||||
/**
|
||||
* Function that takes an ID and returns a path, or Object of id: path pairs.
|
||||
* Where supplied, these paths will be used in the generated bundle instead of the module ID, allowing you to (for example) load dependencies from a CDN.
|
||||
*/
|
||||
paths?: ((id: string) => string) | { [id: string]: string }
|
||||
/** Function that will intercept warning messages. If not supplied, warnings will be deduplicated and printed to the console. */
|
||||
onwarn?(warning: Warning): void
|
||||
/** Array of plugin objects or a single plugin object */
|
||||
@@ -118,6 +118,10 @@ export interface Options {
|
||||
legacy?: boolean
|
||||
}
|
||||
|
||||
export interface ConfigFileOptions extends Options {
|
||||
output: WriteOptions | WriteOptions[]
|
||||
}
|
||||
|
||||
// https://github.com/rollup/rollup/wiki/Plugins#creating-plugins
|
||||
export interface Plugin {
|
||||
/** The name of the plugin, for use in error messages and warnings */
|
||||
@@ -133,7 +137,7 @@ export interface Plugin {
|
||||
*/
|
||||
resolveId?(importee: string, importer: string): string | null | undefined | false | 0 | ''
|
||||
/** A module transformer function */
|
||||
transform?(source: string, id: string): string | { code: string, map: SourceMap }
|
||||
transform?(this: TransformContext, source: string, id: string): string | { code: string, map: SourceMap }
|
||||
/** A bundle transformer function */
|
||||
transformBundle?(source: string, options: { format: Format }): string | { code: string, map: SourceMap }
|
||||
/** Function hook called when bundle.generate() is being executed. */
|
||||
@@ -150,5 +154,13 @@ export interface Plugin {
|
||||
footer?: string | (() => string)
|
||||
}
|
||||
|
||||
// See https://github.com/rollup/rollup/wiki/Plugins#warnings-and-errors
|
||||
export interface TransformContext {
|
||||
/** Emit warnings to Rollup which will be logged during bundling */
|
||||
warn(message: string | { message: string }, pos?: number | { line: number, column: number }): void
|
||||
/** Emit an error, which will abort the bundling process */
|
||||
error(message: string | { message: string }, pos?: number | { line: number, column: number }): void
|
||||
}
|
||||
|
||||
/** Returns a Promise that resolves with a bundle */
|
||||
export function rollup(options: Options): Promise<Bundle>
|
||||
|
||||
@@ -1,23 +1,96 @@
|
||||
import { rollup, Bundle } from 'rollup'
|
||||
import { rollup, Bundle, Plugin, ConfigFileOptions } from 'rollup'
|
||||
|
||||
declare const console: { log(...messages: any[]): void, warn(message: string): void }
|
||||
|
||||
let cache: Bundle | undefined
|
||||
const plugin: Plugin = {
|
||||
name: 'test-plugin',
|
||||
transform(source, id) {
|
||||
if (id === 'rxjs') {
|
||||
this.error(new Error(`Don't import this directly`))
|
||||
}
|
||||
const indexOfQuote = source.indexOf('"')
|
||||
if (indexOfQuote >= 0) {
|
||||
this.warn(`Prefer ' over " for strings`, indexOfQuote)
|
||||
}
|
||||
return source
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const bundle = await rollup({
|
||||
entry: 'main.js',
|
||||
input: 'main.js',
|
||||
external: ['external-module'],
|
||||
plugins: [plugin],
|
||||
onwarn: ({ code, frame, loc, message }) => {
|
||||
if (loc) {
|
||||
const { file, line, column } = loc
|
||||
console.log(`[${code}] - ${file}(${line},${column}): ${message}`)
|
||||
} else {
|
||||
console.log(`[${code}] - ${message}`)
|
||||
}
|
||||
|
||||
if (frame) console.warn(frame)
|
||||
},
|
||||
cache,
|
||||
})
|
||||
|
||||
const result = bundle.generate({
|
||||
format: 'cjs',
|
||||
const bundle2 = await rollup({
|
||||
input: 'main.js',
|
||||
external: id => /^rxjs/.test(id),
|
||||
plugins: plugin
|
||||
})
|
||||
|
||||
const { code, map } = await bundle.generate({
|
||||
format: 'cjs',
|
||||
indent: false,
|
||||
sourcemap: true,
|
||||
})
|
||||
|
||||
console.log(code, map)
|
||||
|
||||
cache = bundle
|
||||
|
||||
await bundle.write({
|
||||
format: 'cjs',
|
||||
dest: 'bundle.js',
|
||||
file: 'bundle.js',
|
||||
name: 'myLib',
|
||||
interop: false,
|
||||
globals: {
|
||||
jquery: '$',
|
||||
lodash: '_',
|
||||
},
|
||||
banner: '/* Banner */',
|
||||
footer: '/* Footer */',
|
||||
intro: 'var ENV = "production";',
|
||||
outro: 'var VERSION = "1.0.0";',
|
||||
indent: ' ',
|
||||
sourcemap: 'inline',
|
||||
sourcemapFile: 'bundle.js.map',
|
||||
strict: true,
|
||||
})
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
export const defaultConfig: ConfigFileOptions = {
|
||||
input: 'main.js',
|
||||
output: {
|
||||
file: 'bundle.js',
|
||||
format: 'iife',
|
||||
}
|
||||
}
|
||||
|
||||
export const multiConfig: ConfigFileOptions = {
|
||||
input: 'main.js',
|
||||
output: [
|
||||
{
|
||||
file: 'bundle.esm.js',
|
||||
format: 'es',
|
||||
},
|
||||
{
|
||||
file: 'bundle.cjs.js',
|
||||
format: 'cjs',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+768
@@ -0,0 +1,768 @@
|
||||
// Type definitions for uinput 1.1
|
||||
// Project: https://github.com/santigimeno/node-uinput#readme
|
||||
// Definitions by: Florian Richter <https://github.com/Fidge123>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from "fs";
|
||||
|
||||
export interface SetupOptions {
|
||||
EV_KEY: any[];
|
||||
}
|
||||
|
||||
export interface CreateOptions {
|
||||
name: string;
|
||||
id: CreateID;
|
||||
}
|
||||
|
||||
export interface CreateID {
|
||||
bustype: number;
|
||||
vendor: number;
|
||||
product: number;
|
||||
version: number;
|
||||
ff_effects_max?: number;
|
||||
absmax?: number[];
|
||||
absmin?: number[];
|
||||
absfuzz?: number[];
|
||||
absflat?: number[];
|
||||
}
|
||||
|
||||
export function setup(
|
||||
options: SetupOptions,
|
||||
callback: (err: Error, stream: fs.WriteStream) => void
|
||||
): void;
|
||||
export function create(
|
||||
stream: fs.WriteStream,
|
||||
options: CreateOptions,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
export function send_event(
|
||||
stream: fs.WriteStream,
|
||||
typeParam: number,
|
||||
code: number,
|
||||
value: number,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
export function key_event(
|
||||
stream: fs.WriteStream,
|
||||
code: number,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
export function emit_combo(
|
||||
stream: fs.WriteStream,
|
||||
codes: number[],
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
|
||||
export const BUS_PCI: number;
|
||||
export const BUS_ISAPNP: number;
|
||||
export const BUS_USB: number;
|
||||
export const BUS_HIL: number;
|
||||
export const BUS_BLUETOOTH: number;
|
||||
export const BUS_VIRTUAL: number;
|
||||
export const BUS_ISA: number;
|
||||
export const BUS_I8042: number;
|
||||
export const BUS_XTKBD: number;
|
||||
export const BUS_RS232: number;
|
||||
export const BUS_GAMEPORT: number;
|
||||
export const BUS_PARPORT: number;
|
||||
export const BUS_AMIGA: number;
|
||||
export const BUS_ADB: number;
|
||||
export const BUS_I2C: number;
|
||||
export const BUS_HOST: number;
|
||||
export const BUS_GSC: number;
|
||||
export const BUS_ATARI: number;
|
||||
export const BUS_SPI: number;
|
||||
|
||||
export const KEY_RESERVED: number;
|
||||
export const KEY_ESC: number;
|
||||
export const KEY_1: number;
|
||||
export const KEY_2: number;
|
||||
export const KEY_3: number;
|
||||
export const KEY_4: number;
|
||||
export const KEY_5: number;
|
||||
export const KEY_6: number;
|
||||
export const KEY_7: number;
|
||||
export const KEY_8: number;
|
||||
export const KEY_9: number;
|
||||
export const KEY_0: number;
|
||||
export const KEY_MINUS: number;
|
||||
export const KEY_EQUAL: number;
|
||||
export const KEY_BACKSPACE: number;
|
||||
export const KEY_TAB: number;
|
||||
export const KEY_Q: number;
|
||||
export const KEY_W: number;
|
||||
export const KEY_E: number;
|
||||
export const KEY_R: number;
|
||||
export const KEY_T: number;
|
||||
export const KEY_Y: number;
|
||||
export const KEY_U: number;
|
||||
export const KEY_I: number;
|
||||
export const KEY_O: number;
|
||||
export const KEY_P: number;
|
||||
export const KEY_LEFTBRACE: number;
|
||||
export const KEY_RIGHTBRACE: number;
|
||||
export const KEY_ENTER: number;
|
||||
export const KEY_LEFTCTRL: number;
|
||||
export const KEY_A: number;
|
||||
export const KEY_S: number;
|
||||
export const KEY_D: number;
|
||||
export const KEY_F: number;
|
||||
export const KEY_G: number;
|
||||
export const KEY_H: number;
|
||||
export const KEY_J: number;
|
||||
export const KEY_K: number;
|
||||
export const KEY_L: number;
|
||||
export const KEY_SEMICOLON: number;
|
||||
export const KEY_APOSTROPHE: number;
|
||||
export const KEY_GRAVE: number;
|
||||
export const KEY_LEFTSHIFT: number;
|
||||
export const KEY_BACKSLASH: number;
|
||||
export const KEY_Z: number;
|
||||
export const KEY_X: number;
|
||||
export const KEY_C: number;
|
||||
export const KEY_V: number;
|
||||
export const KEY_B: number;
|
||||
export const KEY_N: number;
|
||||
export const KEY_M: number;
|
||||
export const KEY_COMMA: number;
|
||||
export const KEY_DOT: number;
|
||||
export const KEY_SLASH: number;
|
||||
export const KEY_RIGHTSHIFT: number;
|
||||
export const KEY_KPASTERISK: number;
|
||||
export const KEY_LEFTALT: number;
|
||||
export const KEY_SPACE: number;
|
||||
export const KEY_CAPSLOCK: number;
|
||||
export const KEY_F1: number;
|
||||
export const KEY_F2: number;
|
||||
export const KEY_F3: number;
|
||||
export const KEY_F4: number;
|
||||
export const KEY_F5: number;
|
||||
export const KEY_F6: number;
|
||||
export const KEY_F7: number;
|
||||
export const KEY_F8: number;
|
||||
export const KEY_F9: number;
|
||||
export const KEY_F10: number;
|
||||
export const KEY_NUMLOCK: number;
|
||||
export const KEY_SCROLLLOCK: number;
|
||||
export const KEY_KP7: number;
|
||||
export const KEY_KP8: number;
|
||||
export const KEY_KP9: number;
|
||||
export const KEY_KPMINUS: number;
|
||||
export const KEY_KP4: number;
|
||||
export const KEY_KP5: number;
|
||||
export const KEY_KP6: number;
|
||||
export const KEY_KPPLUS: number;
|
||||
export const KEY_KP1: number;
|
||||
export const KEY_KP2: number;
|
||||
export const KEY_KP3: number;
|
||||
export const KEY_KP0: number;
|
||||
export const KEY_KPDOT: number;
|
||||
export const KEY_ZENKAKUHANKAKU: number;
|
||||
export const KEY_102ND: number;
|
||||
export const KEY_F11: number;
|
||||
export const KEY_F12: number;
|
||||
export const KEY_RO: number;
|
||||
export const KEY_KATAKANA: number;
|
||||
export const KEY_HIRAGANA: number;
|
||||
export const KEY_HENKAN: number;
|
||||
export const KEY_KATAKANAHIRAGANA: number;
|
||||
export const KEY_MUHENKAN: number;
|
||||
export const KEY_KPJPCOMMA: number;
|
||||
export const KEY_KPENTER: number;
|
||||
export const KEY_RIGHTCTRL: number;
|
||||
export const KEY_KPSLASH: number;
|
||||
export const KEY_SYSRQ: number;
|
||||
export const KEY_RIGHTALT: number;
|
||||
export const KEY_LINEFEED: number;
|
||||
export const KEY_HOME: number;
|
||||
export const KEY_UP: number;
|
||||
export const KEY_PAGEUP: number;
|
||||
export const KEY_LEFT: number;
|
||||
export const KEY_RIGHT: number;
|
||||
export const KEY_END: number;
|
||||
export const KEY_DOWN: number;
|
||||
export const KEY_PAGEDOWN: number;
|
||||
export const KEY_INSERT: number;
|
||||
export const KEY_DELETE: number;
|
||||
export const KEY_MACRO: number;
|
||||
export const KEY_MUTE: number;
|
||||
export const KEY_VOLUMEDOWN: number;
|
||||
export const KEY_VOLUMEUP: number;
|
||||
export const KEY_POWER: number;
|
||||
export const KEY_KPEQUAL: number;
|
||||
export const KEY_KPPLUSMINUS: number;
|
||||
export const KEY_PAUSE: number;
|
||||
export const KEY_SCALE: number;
|
||||
export const KEY_KPCOMMA: number;
|
||||
export const KEY_HANGEUL: number;
|
||||
export const KEY_HANJA: number;
|
||||
export const KEY_YEN: number;
|
||||
export const KEY_LEFTMETA: number;
|
||||
export const KEY_RIGHTMETA: number;
|
||||
export const KEY_COMPOSE: number;
|
||||
export const KEY_STOP: number;
|
||||
export const KEY_AGAIN: number;
|
||||
export const KEY_PROPS: number;
|
||||
export const KEY_UNDO: number;
|
||||
export const KEY_FRONT: number;
|
||||
export const KEY_COPY: number;
|
||||
export const KEY_OPEN: number;
|
||||
export const KEY_PASTE: number;
|
||||
export const KEY_FIND: number;
|
||||
export const KEY_CUT: number;
|
||||
export const KEY_HELP: number;
|
||||
export const KEY_MENU: number;
|
||||
export const KEY_CALC: number;
|
||||
export const KEY_SETUP: number;
|
||||
export const KEY_SLEEP: number;
|
||||
export const KEY_WAKEUP: number;
|
||||
export const KEY_FILE: number;
|
||||
export const KEY_SENDFILE: number;
|
||||
export const KEY_DELETEFILE: number;
|
||||
export const KEY_XFER: number;
|
||||
export const KEY_PROG1: number;
|
||||
export const KEY_PROG2: number;
|
||||
export const KEY_WWW: number;
|
||||
export const KEY_MSDOS: number;
|
||||
export const KEY_COFFEE: number;
|
||||
export const KEY_ROTATE_DISPLAY: number;
|
||||
export const KEY_CYCLEWINDOWS: number;
|
||||
export const KEY_MAIL: number;
|
||||
export const KEY_BOOKMARKS: number;
|
||||
export const KEY_COMPUTER: number;
|
||||
export const KEY_BACK: number;
|
||||
export const KEY_FORWARD: number;
|
||||
export const KEY_CLOSECD: number;
|
||||
export const KEY_EJECTCD: number;
|
||||
export const KEY_EJECTCLOSECD: number;
|
||||
export const KEY_NEXTSONG: number;
|
||||
export const KEY_PLAYPAUSE: number;
|
||||
export const KEY_PREVIOUSSONG: number;
|
||||
export const KEY_STOPCD: number;
|
||||
export const KEY_RECORD: number;
|
||||
export const KEY_REWIND: number;
|
||||
export const KEY_PHONE: number;
|
||||
export const KEY_ISO: number;
|
||||
export const KEY_CONFIG: number;
|
||||
export const KEY_HOMEPAGE: number;
|
||||
export const KEY_REFRESH: number;
|
||||
export const KEY_EXIT: number;
|
||||
export const KEY_MOVE: number;
|
||||
export const KEY_EDIT: number;
|
||||
export const KEY_SCROLLUP: number;
|
||||
export const KEY_SCROLLDOWN: number;
|
||||
export const KEY_KPLEFTPAREN: number;
|
||||
export const KEY_KPRIGHTPAREN: number;
|
||||
export const KEY_NEW: number;
|
||||
export const KEY_REDO: number;
|
||||
export const KEY_F13: number;
|
||||
export const KEY_F14: number;
|
||||
export const KEY_F15: number;
|
||||
export const KEY_F16: number;
|
||||
export const KEY_F17: number;
|
||||
export const KEY_F18: number;
|
||||
export const KEY_F19: number;
|
||||
export const KEY_F20: number;
|
||||
export const KEY_F21: number;
|
||||
export const KEY_F22: number;
|
||||
export const KEY_F23: number;
|
||||
export const KEY_F24: number;
|
||||
export const KEY_PLAYCD: number;
|
||||
export const KEY_PAUSECD: number;
|
||||
export const KEY_PROG3: number;
|
||||
export const KEY_PROG4: number;
|
||||
export const KEY_DASHBOARD: number;
|
||||
export const KEY_SUSPEND: number;
|
||||
export const KEY_CLOSE: number;
|
||||
export const KEY_PLAY: number;
|
||||
export const KEY_FASTFORWARD: number;
|
||||
export const KEY_BASSBOOST: number;
|
||||
export const KEY_PRINT: number;
|
||||
export const KEY_HP: number;
|
||||
export const KEY_CAMERA: number;
|
||||
export const KEY_SOUND: number;
|
||||
export const KEY_QUESTION: number;
|
||||
export const KEY_EMAIL: number;
|
||||
export const KEY_CHAT: number;
|
||||
export const KEY_SEARCH: number;
|
||||
export const KEY_CONNECT: number;
|
||||
export const KEY_FINANCE: number;
|
||||
export const KEY_SPORT: number;
|
||||
export const KEY_SHOP: number;
|
||||
export const KEY_ALTERASE: number;
|
||||
export const KEY_CANCEL: number;
|
||||
export const KEY_BRIGHTNESSDOWN: number;
|
||||
export const KEY_BRIGHTNESSUP: number;
|
||||
export const KEY_MEDIA: number;
|
||||
export const KEY_SWITCHVIDEOMODE: number;
|
||||
export const KEY_KBDILLUMTOGGLE: number;
|
||||
export const KEY_KBDILLUMDOWN: number;
|
||||
export const KEY_KBDILLUMUP: number;
|
||||
export const KEY_SEND: number;
|
||||
export const KEY_REPLY: number;
|
||||
export const KEY_FORWARDMAIL: number;
|
||||
export const KEY_SAVE: number;
|
||||
export const KEY_DOCUMENTS: number;
|
||||
export const KEY_BATTERY: number;
|
||||
export const KEY_BLUETOOTH: number;
|
||||
export const KEY_WLAN: number;
|
||||
export const KEY_UWB: number;
|
||||
export const KEY_UNKNOWN: number;
|
||||
export const KEY_VIDEO_NEXT: number;
|
||||
export const KEY_VIDEO_PREV: number;
|
||||
export const KEY_BRIGHTNESS_CYCLE: number;
|
||||
export const KEY_BRIGHTNESS_AUTO: number;
|
||||
export const KEY_DISPLAY_OFF: number;
|
||||
export const KEY_WWAN: number;
|
||||
export const KEY_RFKILL: number;
|
||||
export const KEY_MICMUTE: number;
|
||||
|
||||
export const BTN_MISC: number;
|
||||
export const BTN_0: number;
|
||||
export const BTN_1: number;
|
||||
export const BTN_2: number;
|
||||
export const BTN_3: number;
|
||||
export const BTN_4: number;
|
||||
export const BTN_5: number;
|
||||
export const BTN_6: number;
|
||||
export const BTN_7: number;
|
||||
export const BTN_8: number;
|
||||
export const BTN_9: number;
|
||||
|
||||
export const BTN_MOUSE: number;
|
||||
export const BTN_LEFT: number;
|
||||
export const BTN_RIGHT: number;
|
||||
export const BTN_MIDDLE: number;
|
||||
export const BTN_SIDE: number;
|
||||
export const BTN_EXTRA: number;
|
||||
export const BTN_FORWARD: number;
|
||||
export const BTN_BACK: number;
|
||||
export const BTN_TASK: number;
|
||||
|
||||
export const BTN_JOYSTICK: number;
|
||||
export const BTN_TRIGGER: number;
|
||||
export const BTN_THUMB: number;
|
||||
export const BTN_THUMB2: number;
|
||||
export const BTN_TOP: number;
|
||||
export const BTN_TOP2: number;
|
||||
export const BTN_PINKIE: number;
|
||||
export const BTN_BASE: number;
|
||||
export const BTN_BASE2: number;
|
||||
export const BTN_BASE3: number;
|
||||
export const BTN_BASE4: number;
|
||||
export const BTN_BASE5: number;
|
||||
export const BTN_BASE6: number;
|
||||
export const BTN_DEAD: number;
|
||||
|
||||
export const BTN_GAMEPAD: number;
|
||||
export const BTN_SOUTH: number;
|
||||
export const BTN_EAST: number;
|
||||
export const BTN_C: number;
|
||||
export const BTN_NORTH: number;
|
||||
export const BTN_WEST: number;
|
||||
export const BTN_Z: number;
|
||||
export const BTN_TL: number;
|
||||
export const BTN_TR: number;
|
||||
export const BTN_TL2: number;
|
||||
export const BTN_TR2: number;
|
||||
export const BTN_SELECT: number;
|
||||
export const BTN_START: number;
|
||||
export const BTN_MODE: number;
|
||||
export const BTN_THUMBL: number;
|
||||
export const BTN_THUMBR: number;
|
||||
|
||||
export const BTN_DIGI: number;
|
||||
export const BTN_TOOL_PEN: number;
|
||||
export const BTN_TOOL_RUBBER: number;
|
||||
export const BTN_TOOL_BRUSH: number;
|
||||
export const BTN_TOOL_PENCIL: number;
|
||||
export const BTN_TOOL_AIRBRUSH: number;
|
||||
export const BTN_TOOL_FINGER: number;
|
||||
export const BTN_TOOL_MOUSE: number;
|
||||
export const BTN_TOOL_LENS: number;
|
||||
export const BTN_TOOL_QUINTTAP: number;
|
||||
export const BTN_TOUCH: number;
|
||||
export const BTN_STYLUS: number;
|
||||
export const BTN_STYLUS2: number;
|
||||
export const BTN_TOOL_DOUBLETAP: number;
|
||||
export const BTN_TOOL_TRIPLETAP: number;
|
||||
export const BTN_TOOL_QUADTAP: number;
|
||||
|
||||
export const BTN_WHEEL: number;
|
||||
export const BTN_GEAR_DOWN: number;
|
||||
export const BTN_GEAR_UP: number;
|
||||
|
||||
export const BTN_DPAD_UP: number;
|
||||
export const BTN_DPAD_DOWN: number;
|
||||
export const BTN_DPAD_LEFT: number;
|
||||
export const BTN_DPAD_RIGHT: number;
|
||||
|
||||
export const BTN_TRIGGER_HAPPY: number;
|
||||
export const BTN_TRIGGER_HAPPY1: number;
|
||||
export const BTN_TRIGGER_HAPPY2: number;
|
||||
export const BTN_TRIGGER_HAPPY3: number;
|
||||
export const BTN_TRIGGER_HAPPY4: number;
|
||||
export const BTN_TRIGGER_HAPPY5: number;
|
||||
export const BTN_TRIGGER_HAPPY6: number;
|
||||
export const BTN_TRIGGER_HAPPY7: number;
|
||||
export const BTN_TRIGGER_HAPPY8: number;
|
||||
export const BTN_TRIGGER_HAPPY9: number;
|
||||
export const BTN_TRIGGER_HAPPY10: number;
|
||||
export const BTN_TRIGGER_HAPPY11: number;
|
||||
export const BTN_TRIGGER_HAPPY12: number;
|
||||
export const BTN_TRIGGER_HAPPY13: number;
|
||||
export const BTN_TRIGGER_HAPPY14: number;
|
||||
export const BTN_TRIGGER_HAPPY15: number;
|
||||
export const BTN_TRIGGER_HAPPY16: number;
|
||||
export const BTN_TRIGGER_HAPPY17: number;
|
||||
export const BTN_TRIGGER_HAPPY18: number;
|
||||
export const BTN_TRIGGER_HAPPY19: number;
|
||||
export const BTN_TRIGGER_HAPPY20: number;
|
||||
export const BTN_TRIGGER_HAPPY21: number;
|
||||
export const BTN_TRIGGER_HAPPY22: number;
|
||||
export const BTN_TRIGGER_HAPPY23: number;
|
||||
export const BTN_TRIGGER_HAPPY24: number;
|
||||
export const BTN_TRIGGER_HAPPY25: number;
|
||||
export const BTN_TRIGGER_HAPPY26: number;
|
||||
export const BTN_TRIGGER_HAPPY27: number;
|
||||
export const BTN_TRIGGER_HAPPY28: number;
|
||||
export const BTN_TRIGGER_HAPPY29: number;
|
||||
export const BTN_TRIGGER_HAPPY30: number;
|
||||
export const BTN_TRIGGER_HAPPY31: number;
|
||||
export const BTN_TRIGGER_HAPPY32: number;
|
||||
export const BTN_TRIGGER_HAPPY33: number;
|
||||
export const BTN_TRIGGER_HAPPY34: number;
|
||||
export const BTN_TRIGGER_HAPPY35: number;
|
||||
export const BTN_TRIGGER_HAPPY36: number;
|
||||
export const BTN_TRIGGER_HAPPY37: number;
|
||||
export const BTN_TRIGGER_HAPPY38: number;
|
||||
export const BTN_TRIGGER_HAPPY39: number;
|
||||
export const BTN_TRIGGER_HAPPY40: number;
|
||||
|
||||
export const KEY_OK: number;
|
||||
export const KEY_SELECT: number;
|
||||
export const KEY_GOTO: number;
|
||||
export const KEY_CLEAR: number;
|
||||
export const KEY_POWER2: number;
|
||||
export const KEY_OPTION: number;
|
||||
export const KEY_INFO: number;
|
||||
export const KEY_TIME: number;
|
||||
export const KEY_VENDOR: number;
|
||||
export const KEY_ARCHIVE: number;
|
||||
export const KEY_PROGRAM: number;
|
||||
export const KEY_CHANNEL: number;
|
||||
export const KEY_FAVORITES: number;
|
||||
export const KEY_EPG: number;
|
||||
export const KEY_PVR: number;
|
||||
export const KEY_MHP: number;
|
||||
export const KEY_LANGUAGE: number;
|
||||
export const KEY_TITLE: number;
|
||||
export const KEY_SUBTITLE: number;
|
||||
export const KEY_ANGLE: number;
|
||||
export const KEY_ZOOM: number;
|
||||
export const KEY_MODE: number;
|
||||
export const KEY_KEYBOARD: number;
|
||||
export const KEY_SCREEN: number;
|
||||
export const KEY_PC: number;
|
||||
export const KEY_TV: number;
|
||||
export const KEY_TV2: number;
|
||||
export const KEY_VCR: number;
|
||||
export const KEY_VCR2: number;
|
||||
export const KEY_SAT: number;
|
||||
export const KEY_SAT2: number;
|
||||
export const KEY_CD: number;
|
||||
export const KEY_TAPE: number;
|
||||
export const KEY_RADIO: number;
|
||||
export const KEY_TUNER: number;
|
||||
export const KEY_PLAYER: number;
|
||||
export const KEY_TEXT: number;
|
||||
export const KEY_DVD: number;
|
||||
export const KEY_AUX: number;
|
||||
export const KEY_MP3: number;
|
||||
export const KEY_AUDIO: number;
|
||||
export const KEY_VIDEO: number;
|
||||
export const KEY_DIRECTORY: number;
|
||||
export const KEY_LIST: number;
|
||||
export const KEY_MEMO: number;
|
||||
export const KEY_CALENDAR: number;
|
||||
export const KEY_RED: number;
|
||||
export const KEY_GREEN: number;
|
||||
export const KEY_YELLOW: number;
|
||||
export const KEY_BLUE: number;
|
||||
export const KEY_CHANNELUP: number;
|
||||
export const KEY_CHANNELDOWN: number;
|
||||
export const KEY_FIRST: number;
|
||||
export const KEY_LAST: number;
|
||||
export const KEY_AB: number;
|
||||
export const KEY_NEXT: number;
|
||||
export const KEY_RESTART: number;
|
||||
export const KEY_SLOW: number;
|
||||
export const KEY_SHUFFLE: number;
|
||||
export const KEY_BREAK: number;
|
||||
export const KEY_PREVIOUS: number;
|
||||
export const KEY_DIGITS: number;
|
||||
export const KEY_TEEN: number;
|
||||
export const KEY_TWEN: number;
|
||||
export const KEY_VIDEOPHONE: number;
|
||||
export const KEY_GAMES: number;
|
||||
export const KEY_ZOOMIN: number;
|
||||
export const KEY_ZOOMOUT: number;
|
||||
export const KEY_ZOOMRESET: number;
|
||||
export const KEY_WORDPROCESSOR: number;
|
||||
export const KEY_EDITOR: number;
|
||||
export const KEY_SPREADSHEET: number;
|
||||
export const KEY_GRAPHICSEDITOR: number;
|
||||
export const KEY_PRESENTATION: number;
|
||||
export const KEY_DATABASE: number;
|
||||
export const KEY_NEWS: number;
|
||||
export const KEY_VOICEMAIL: number;
|
||||
export const KEY_ADDRESSBOOK: number;
|
||||
export const KEY_MESSENGER: number;
|
||||
export const KEY_DISPLAYTOGGLE: number;
|
||||
export const KEY_SPELLCHECK: number;
|
||||
export const KEY_LOGOFF: number;
|
||||
|
||||
export const KEY_DOLLAR: number;
|
||||
export const KEY_EURO: number;
|
||||
|
||||
export const KEY_FRAMEBACK: number;
|
||||
export const KEY_FRAMEFORWARD: number;
|
||||
export const KEY_CONTEXT_MENU: number;
|
||||
export const KEY_MEDIA_REPEAT: number;
|
||||
export const KEY_10CHANNELSUP: number;
|
||||
export const KEY_10CHANNELSDOWN: number;
|
||||
export const KEY_IMAGES: number;
|
||||
|
||||
export const KEY_DEL_EOL: number;
|
||||
export const KEY_DEL_EOS: number;
|
||||
export const KEY_INS_LINE: number;
|
||||
export const KEY_DEL_LINE: number;
|
||||
|
||||
export const KEY_FN: number;
|
||||
export const KEY_FN_ESC: number;
|
||||
export const KEY_FN_F1: number;
|
||||
export const KEY_FN_F2: number;
|
||||
export const KEY_FN_F3: number;
|
||||
export const KEY_FN_F4: number;
|
||||
export const KEY_FN_F5: number;
|
||||
export const KEY_FN_F6: number;
|
||||
export const KEY_FN_F7: number;
|
||||
export const KEY_FN_F8: number;
|
||||
export const KEY_FN_F9: number;
|
||||
export const KEY_FN_F10: number;
|
||||
export const KEY_FN_F11: number;
|
||||
export const KEY_FN_F12: number;
|
||||
export const KEY_FN_1: number;
|
||||
export const KEY_FN_2: number;
|
||||
export const KEY_FN_D: number;
|
||||
export const KEY_FN_E: number;
|
||||
export const KEY_FN_F: number;
|
||||
export const KEY_FN_S: number;
|
||||
export const KEY_FN_B: number;
|
||||
|
||||
export const KEY_BRL_DOT1: number;
|
||||
export const KEY_BRL_DOT2: number;
|
||||
export const KEY_BRL_DOT3: number;
|
||||
export const KEY_BRL_DOT4: number;
|
||||
export const KEY_BRL_DOT5: number;
|
||||
export const KEY_BRL_DOT6: number;
|
||||
export const KEY_BRL_DOT7: number;
|
||||
export const KEY_BRL_DOT8: number;
|
||||
export const KEY_BRL_DOT9: number;
|
||||
export const KEY_BRL_DOT10: number;
|
||||
|
||||
export const KEY_NUMERIC_0: number;
|
||||
export const KEY_NUMERIC_1: number;
|
||||
export const KEY_NUMERIC_2: number;
|
||||
export const KEY_NUMERIC_3: number;
|
||||
export const KEY_NUMERIC_4: number;
|
||||
export const KEY_NUMERIC_5: number;
|
||||
export const KEY_NUMERIC_6: number;
|
||||
export const KEY_NUMERIC_7: number;
|
||||
export const KEY_NUMERIC_8: number;
|
||||
export const KEY_NUMERIC_9: number;
|
||||
export const KEY_NUMERIC_STAR: number;
|
||||
export const KEY_NUMERIC_POUND: number;
|
||||
export const KEY_NUMERIC_A: number;
|
||||
export const KEY_NUMERIC_B: number;
|
||||
export const KEY_NUMERIC_C: number;
|
||||
export const KEY_NUMERIC_D: number;
|
||||
|
||||
export const KEY_CAMERA_FOCUS: number;
|
||||
export const KEY_WPS_BUTTON: number;
|
||||
|
||||
export const KEY_TOUCHPAD_TOGGLE: number;
|
||||
export const KEY_TOUCHPAD_ON: number;
|
||||
export const KEY_TOUCHPAD_OFF: number;
|
||||
|
||||
export const KEY_CAMERA_ZOOMIN: number;
|
||||
export const KEY_CAMERA_ZOOMOUT: number;
|
||||
export const KEY_CAMERA_UP: number;
|
||||
export const KEY_CAMERA_DOWN: number;
|
||||
export const KEY_CAMERA_LEFT: number;
|
||||
export const KEY_CAMERA_RIGHT: number;
|
||||
|
||||
export const KEY_ATTENDANT_ON: number;
|
||||
export const KEY_ATTENDANT_OFF: number;
|
||||
export const KEY_ATTENDANT_TOGGLE: number;
|
||||
export const KEY_LIGHTS_TOGGLE: number;
|
||||
|
||||
export const KEY_ALS_TOGGLE: number;
|
||||
|
||||
export const KEY_BUTTONCONFIG: number;
|
||||
export const KEY_TASKMANAGER: number;
|
||||
export const KEY_JOURNAL: number;
|
||||
export const KEY_CONTROLPANEL: number;
|
||||
export const KEY_APPSELECT: number;
|
||||
export const KEY_SCREENSAVER: number;
|
||||
export const KEY_VOICECOMMAND: number;
|
||||
export const KEY_ASSISTANT: number;
|
||||
|
||||
export const KEY_BRIGHTNESS_MIN: number;
|
||||
export const KEY_BRIGHTNESS_MAX: number;
|
||||
|
||||
export const KEY_KBDINPUTASSIST_PREV: number;
|
||||
export const KEY_KBDINPUTASSIST_NEXT: number;
|
||||
export const KEY_KBDINPUTASSIST_PREVGROUP: number;
|
||||
export const KEY_KBDINPUTASSIST_NEXTGROUP: number;
|
||||
export const KEY_KBDINPUTASSIST_ACCEPT: number;
|
||||
export const KEY_KBDINPUTASSIST_CANCEL: number;
|
||||
|
||||
export const KEY_RIGHT_UP: number;
|
||||
export const KEY_RIGHT_DOWN: number;
|
||||
export const KEY_LEFT_UP: number;
|
||||
export const KEY_LEFT_DOWN: number;
|
||||
|
||||
export const KEY_ROOT_MENU: number;
|
||||
|
||||
export const KEY_MEDIA_TOP_MENU: number;
|
||||
export const KEY_NUMERIC_11: number;
|
||||
export const KEY_NUMERIC_12: number;
|
||||
export const KEY_AUDIO_DESC: number;
|
||||
export const KEY_3D_MODE: number;
|
||||
export const KEY_NEXT_FAVORITE: number;
|
||||
export const KEY_STOP_RECORD: number;
|
||||
export const KEY_PAUSE_RECORD: number;
|
||||
export const KEY_VOD: number;
|
||||
export const KEY_UNMUTE: number;
|
||||
export const KEY_FASTREVERSE: number;
|
||||
export const KEY_SLOWREVERSE: number;
|
||||
export const KEY_DATA: number;
|
||||
export const KEY_ONSCREEN_KEYBOARD: number;
|
||||
|
||||
export const KEY_MAX: number;
|
||||
export const KEY_CNT: number;
|
||||
export const REL_X: number;
|
||||
export const REL_Y: number;
|
||||
export const REL_Z: number;
|
||||
export const REL_RX: number;
|
||||
export const REL_RY: number;
|
||||
export const REL_RZ: number;
|
||||
export const REL_HWHEEL: number;
|
||||
export const REL_DIAL: number;
|
||||
export const REL_WHEEL: number;
|
||||
export const REL_MISC: number;
|
||||
export const REL_MAX: number;
|
||||
export const REL_CNT: number;
|
||||
export const ABS_X: number;
|
||||
export const ABS_Y: number;
|
||||
export const ABS_Z: number;
|
||||
export const ABS_RX: number;
|
||||
export const ABS_RY: number;
|
||||
export const ABS_RZ: number;
|
||||
export const ABS_THROTTLE: number;
|
||||
export const ABS_RUDDER: number;
|
||||
export const ABS_WHEEL: number;
|
||||
export const ABS_GAS: number;
|
||||
export const ABS_BRAKE: number;
|
||||
export const ABS_HAT0X: number;
|
||||
export const ABS_HAT0Y: number;
|
||||
export const ABS_HAT1X: number;
|
||||
export const ABS_HAT1Y: number;
|
||||
export const ABS_HAT2X: number;
|
||||
export const ABS_HAT2Y: number;
|
||||
export const ABS_HAT3X: number;
|
||||
export const ABS_HAT3Y: number;
|
||||
export const ABS_PRESSURE: number;
|
||||
export const ABS_DISTANCE: number;
|
||||
export const ABS_TILT_X: number;
|
||||
export const ABS_TILT_Y: number;
|
||||
export const ABS_TOOL_WIDTH: number;
|
||||
|
||||
export const ABS_VOLUME: number;
|
||||
|
||||
export const ABS_MISC: number;
|
||||
|
||||
export const ABS_MT_SLOT: number;
|
||||
export const ABS_MT_TOUCH_MAJOR: number;
|
||||
export const ABS_MT_TOUCH_MINOR: number;
|
||||
export const ABS_MT_WIDTH_MAJOR: number;
|
||||
export const ABS_MT_WIDTH_MINOR: number;
|
||||
export const ABS_MT_ORIENTATION: number;
|
||||
export const ABS_MT_POSITION_X: number;
|
||||
export const ABS_MT_POSITION_Y: number;
|
||||
export const ABS_MT_TOOL_TYPE: number;
|
||||
export const ABS_MT_BLOB_ID: number;
|
||||
export const ABS_MT_TRACKING_ID: number;
|
||||
export const ABS_MT_PRESSURE: number;
|
||||
export const ABS_MT_DISTANCE: number;
|
||||
export const ABS_MT_TOOL_X: number;
|
||||
export const ABS_MT_TOOL_Y: number;
|
||||
|
||||
export const ABS_MAX: number;
|
||||
export const ABS_CNT: number;
|
||||
export const SW_LID: number;
|
||||
export const SW_TABLET_MODE: number;
|
||||
export const SW_HEADPHONE_INSERT: number;
|
||||
export const SW_RFKILL_ALL: number;
|
||||
|
||||
export const SW_MICROPHONE_INSERT: number;
|
||||
export const SW_DOCK: number;
|
||||
export const SW_LINEOUT_INSERT: number;
|
||||
export const SW_JACK_PHYSICAL_INSERT: number;
|
||||
export const SW_VIDEOOUT_INSERT: number;
|
||||
export const SW_CAMERA_LENS_COVER: number;
|
||||
export const SW_KEYPAD_SLIDE: number;
|
||||
export const SW_FRONT_PROXIMITY: number;
|
||||
export const SW_ROTATE_LOCK: number;
|
||||
export const SW_LINEIN_INSERT: number;
|
||||
export const SW_MUTE_DEVICE: number;
|
||||
export const SW_PEN_INSERTED: number;
|
||||
export const SW_MAX: number;
|
||||
export const SW_CNT: number;
|
||||
|
||||
export const MSC_SERIAL: number;
|
||||
export const MSC_PULSELED: number;
|
||||
export const MSC_GESTURE: number;
|
||||
export const MSC_RAW: number;
|
||||
export const MSC_SCAN: number;
|
||||
export const MSC_TIMESTAMP: number;
|
||||
export const MSC_MAX: number;
|
||||
export const MSC_CNT: number;
|
||||
|
||||
export const LED_NUML: number;
|
||||
export const LED_CAPSL: number;
|
||||
export const LED_SCROLLL: number;
|
||||
export const LED_COMPOSE: number;
|
||||
export const LED_KANA: number;
|
||||
export const LED_SLEEP: number;
|
||||
export const LED_SUSPEND: number;
|
||||
export const LED_MUTE: number;
|
||||
export const LED_MISC: number;
|
||||
export const LED_MAIL: number;
|
||||
export const LED_CHARGING: number;
|
||||
export const LED_MAX: number;
|
||||
export const LED_CNT: number;
|
||||
|
||||
export const REP_DELAY: number;
|
||||
export const REP_PERIOD: number;
|
||||
export const REP_MAX: number;
|
||||
export const REP_CNT: number;
|
||||
|
||||
export const SND_CLICK: number;
|
||||
export const SND_BELL: number;
|
||||
export const SND_TONE: number;
|
||||
export const SND_MAX: number;
|
||||
export const SND_CNT: number;
|
||||
@@ -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",
|
||||
"uinput-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,42 @@
|
||||
import * as fs from "fs";
|
||||
import * as uinput from 'uinput';
|
||||
|
||||
const setupOptions: uinput.SetupOptions = {
|
||||
EV_KEY: [uinput.KEY_A, uinput.KEY_B]
|
||||
};
|
||||
|
||||
const createID: uinput.CreateID = {
|
||||
product: 123,
|
||||
vendor: 456,
|
||||
version: 789,
|
||||
bustype: uinput.BUS_VIRTUAL
|
||||
};
|
||||
|
||||
const createOptions: uinput.CreateOptions = {
|
||||
id: createID,
|
||||
name: "TestDevice"
|
||||
};
|
||||
|
||||
uinput.setup(setupOptions, (err0: Error | undefined, stream: fs.WriteStream): void => {
|
||||
if (err0 instanceof Error) {
|
||||
throw err0;
|
||||
}
|
||||
|
||||
uinput.create(stream, createOptions, (err1?: Error) => {
|
||||
if (err1 instanceof Error) {
|
||||
throw err1;
|
||||
}
|
||||
|
||||
uinput.key_event(stream, uinput.KEY_A, (err2?: Error) => {
|
||||
if (err2 instanceof Error) {
|
||||
throw err2;
|
||||
}
|
||||
});
|
||||
|
||||
uinput.emit_combo(stream, [uinput.KEY_A, uinput.KEY_B], (err3?: Error) => {
|
||||
if (err3 instanceof Error) {
|
||||
throw err3;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
// Type definitions for webpack-manifest-plugin 1.3
|
||||
// Project: https://github.com/danethurber/webpack-manifest-plugin
|
||||
// Definitions by: Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
export = WebpackManifestPlugin;
|
||||
|
||||
declare class WebpackManifestPlugin extends Plugin {
|
||||
constructor(options?: WebpackManifestPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace WebpackManifestPlugin {
|
||||
interface Chunk {
|
||||
id: string;
|
||||
parents: string[];
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
||||
interface HooksOptions {
|
||||
path: string;
|
||||
chunk: Chunk;
|
||||
name: string | null;
|
||||
isChunk: boolean;
|
||||
isInitial: boolean;
|
||||
isAsset: boolean;
|
||||
isModuleAsset: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* The manifest filename in your output directory.
|
||||
* Default: manifest.json
|
||||
*/
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* A path prefix for all file references. Useful for including your output path in the manifest.
|
||||
*/
|
||||
basePath?: string;
|
||||
|
||||
/**
|
||||
* A path prefix used only on output files, similar to Webpack's output.publicPath. Ignored if basePath was also provided.
|
||||
*/
|
||||
publicPath?: string;
|
||||
|
||||
/**
|
||||
* If set to true will emit to build folder and memory in combination with webpack-dev-server
|
||||
* Default: false
|
||||
*/
|
||||
writeToFileEmit?: boolean;
|
||||
|
||||
/**
|
||||
* A cache of key/value pairs to used to seed the manifest. This may include a set of custom key/value pairs to include in your manifest,
|
||||
* or may be used to combine manifests across compilations in multi-compiler mode.
|
||||
* To combine manifests, pass a shared seed object to each compiler's ManifestPlugin instance.
|
||||
* Default: {}
|
||||
*/
|
||||
seed?: object;
|
||||
|
||||
/**
|
||||
* Filter out files.
|
||||
*/
|
||||
filter?: (options: HooksOptions) => void;
|
||||
|
||||
/**
|
||||
* Modify files details before the manifest is created.
|
||||
*/
|
||||
map?: (options: HooksOptions) => void;
|
||||
|
||||
/**
|
||||
* Create the manifest. It can return anything as long as it's serialisable by JSON.stringify. Use the seed options to populate manifest.
|
||||
* Default: (manifest, {name, path}) => ({...manifest, [name]: path})
|
||||
*/
|
||||
reduce?: (manifest: any, options: HooksOptions) => void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpack-manifest-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,38 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import path = require('path');
|
||||
import WebpackManifestPlugin = require('webpack-manifest-plugin');
|
||||
|
||||
const options: WebpackManifestPlugin.Options = {
|
||||
filename: 'manifest.json',
|
||||
basePath: '/src/',
|
||||
seed: {
|
||||
name: 'Hello world',
|
||||
},
|
||||
publicPath: 'prod',
|
||||
writeToFileEmit: false,
|
||||
filter: (file) => file.isInitial,
|
||||
map: (file) => {
|
||||
if (file.name) {
|
||||
file.name = path.join(path.dirname(file.path), file.name);
|
||||
return file;
|
||||
}
|
||||
},
|
||||
reduce: (manifest, { name, path }) => {
|
||||
if (name) {
|
||||
return { ...manifest, [name]: path };
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const c: Configuration = {
|
||||
plugins: [
|
||||
new WebpackManifestPlugin(),
|
||||
new WebpackManifestPlugin({
|
||||
filename: 'my-manifest.json',
|
||||
basePath: '/app/',
|
||||
seed: {
|
||||
name: 'My Manifest',
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user