mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Move all packages to a types directory
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import * as gulp from 'gulp';
|
||||
import * as htmlreplace from 'gulp-html-replace';
|
||||
|
||||
// Examples taken from README.md of the gulp-html-replace project:
|
||||
// https://www.npmjs.com/package/gulp-html-replace
|
||||
|
||||
// Simple examples
|
||||
gulp.task('simple1', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({ js: 'js/main.js' }))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
gulp.task('simple2', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({ js: ['js/monster.js', 'js/hero.js'] }))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
// Advanced examples
|
||||
gulp.task('advanced1', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({
|
||||
js: 'js/main.js',
|
||||
tpl: '<img src="%s" align="left" />'
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
gulp.task('advanced2', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({
|
||||
js: ['data-main.js', 'require-src.js'],
|
||||
tpl: '<img src="%s" align="left" />'
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
// Extended replacements
|
||||
gulp.task('ext1', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({
|
||||
js: {
|
||||
src: null,
|
||||
tpl: '<script src="%f".js></script>'
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
gulp.task('ext2', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({
|
||||
js: {
|
||||
src: 'dir',
|
||||
tpl: '<script src="%f".js></script>'
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
|
||||
// Options example
|
||||
gulp.task('options1', () => {
|
||||
gulp.src('src')
|
||||
.pipe(htmlreplace({
|
||||
js: {
|
||||
src: null,
|
||||
tpl: '<script src="%f".js></script>'
|
||||
}
|
||||
}, {
|
||||
keepUnassigned: false,
|
||||
keepBlockTags: false,
|
||||
resolvePaths: false
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
});
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for gulp-html-replace v1.5.5
|
||||
// Project: https://www.npmjs.com/package/gulp-html-replace
|
||||
// Definitions by: Peter Juras <https://github.com/peterjuras>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
interface AdvancedTask {
|
||||
src: string | string[];
|
||||
tpl: string;
|
||||
}
|
||||
|
||||
interface Tasks {
|
||||
[taskId: string]: string | string[] | AdvancedTask;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
keepUnassigned?: boolean;
|
||||
keepBlockTags?: boolean;
|
||||
resolvePaths?: boolean;
|
||||
}
|
||||
|
||||
interface HtmlReplace {
|
||||
(tasks: Tasks, options?: Options): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
declare const htmlReplace: HtmlReplace;
|
||||
export = htmlReplace;
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"q": [ "q/v0" ]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gulp-html-replace-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user