mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #62764 feat(gulp-live-server): add types by @robertmaier
This commit is contained in:
10
types/gulp-live-server/gulp-live-server-tests.ts
Normal file
10
types/gulp-live-server/gulp-live-server-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as gls from 'gulp-live-server';
|
||||
|
||||
// $ExpectType GLSStatic
|
||||
gls(['command']);
|
||||
|
||||
// $ExpectType GLSStatic
|
||||
gls.static('folder', 123);
|
||||
|
||||
// $ExpectType GLSStatic
|
||||
gls.new('script.js');
|
||||
41
types/gulp-live-server/index.d.ts
vendored
Normal file
41
types/gulp-live-server/index.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Type definitions for gulp-live-server 0.0
|
||||
// Project: https://github.com/gimm/gulp-live-server
|
||||
// Definitions by: robertmaier <https://github.com/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import type { spawn } from 'child_process';
|
||||
import type { createServer } from 'https';
|
||||
import type { Handler, Application } from 'express';
|
||||
|
||||
declare namespace gls {
|
||||
interface LivereloadParams {
|
||||
livereload?: string;
|
||||
port?: number;
|
||||
errorListener?: (error: Error) => void;
|
||||
handler?: Handler;
|
||||
app?: Application;
|
||||
key?: NonNullable<Parameters<typeof createServer>[0]>['key'];
|
||||
cert?: NonNullable<Parameters<typeof createServer>[0]>['cert'];
|
||||
pfx?: NonNullable<Parameters<typeof createServer>[0]>['pfx'];
|
||||
liveCSS?: boolean;
|
||||
liveImg?: boolean;
|
||||
prefix?: boolean;
|
||||
dashboard?: boolean;
|
||||
}
|
||||
type Livereload = boolean | number | LivereloadParams;
|
||||
|
||||
interface GLSStatic {
|
||||
start: (execPath?: string) => void;
|
||||
notify: (event: { path: string }) => void;
|
||||
stop: () => void;
|
||||
static: (folder: string, port?: number) => GLSStatic;
|
||||
new: (script: string) => GLSStatic;
|
||||
}
|
||||
|
||||
type GLS = {
|
||||
(args: Parameters<typeof spawn>[1], options?: Parameters<typeof spawn>[2], livereload?: Livereload): GLSStatic;
|
||||
} & GLSStatic;
|
||||
}
|
||||
|
||||
declare var gls: gls.GLS;
|
||||
export = gls;
|
||||
23
types/gulp-live-server/tsconfig.json
Normal file
23
types/gulp-live-server/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gulp-live-server-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gulp-live-server/tslint.json
Normal file
1
types/gulp-live-server/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user