Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA]: New versión with module types definition #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
examples
43 changes: 43 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Transform } from 'stream'
import { LogReporterOptions } from './log-reporter';

interface CacheOptions {
cacheFileName?: string
}

interface Params {
Bucket: string
}

interface Credentials {
accessKeyId: string
secretAccessKey: string
signatureVersion: string
}

interface AWSConfig {
region: string
credentials: Credentials
params: Params
}

interface PublishOptions {
noAcl: boolean
force: boolean
simulate: boolean
createOnly: boolean
}

interface Headers {
[name: string]: string
}

declare class Publisher {
constructor(awsConfig: AWSConfig, cacheOptions?: CacheOptions);
public publish(headers?: Headers, options?: PublishOptions): Transform;
public cache(): Transform;
}

export function reporter(options?: LogReporterOptions): Transform;

export function create(awsConfig: AWSConfig, cacheOptions?: CacheOptions): Publisher
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,6 @@ Publisher.prototype.sync = function (prefix, whitelistedFiles) {
* @api public
*/

exports.create = function (AWSConfig, cacheOptions) {
module.exports.create = function (AWSConfig, cacheOptions) {
return new Publisher(AWSConfig, cacheOptions);
};
7 changes: 7 additions & 0 deletions lib/log-reporter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Transform } from 'stream'

export interface LogReporterOptions {
states: string[]
}

export default function (options?: LogReporterOptions): Transform
12 changes: 12 additions & 0 deletions lib/s3-paging-stream.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Transform } from 'stream'

declare class Request {
public send(pageHandler: Function): void;
}

interface S3PagingStreamOptions {
read: Function
objectMode: boolean
}

export default function (request: Request, callback: Function, options: S3PagingStreamOptions): Transform
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": "gulp-awspublish",
"version": "4.1.2",
"name": "@pascencio/gulp-awspublish",
"version": "4.3.3",
"description": "gulp plugin to publish files to amazon s3",
"keywords": [
"gulpplugin",
"aws",
"s3",
"publish"
],
"homepage": "https://github.com/pgherveou/gulp-awspublish",
"bugs": "https://github.com/pgherveou/gulp-awspublish/issues",
"homepage": "https://github.com/pascencio/gulp-awspublish",
"bugs": "https://github.com/pascencio/gulp-awspublish/issues",
"author": {
"name": "PG Herveou",
"email": "[email protected]",
"url": "https://github.com/pgherveou"
"url": "https://github.com/pascencio"
},
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/pgherveou/gulp-awspublish.git"
"url": "git://github.com/pascencio/gulp-awspublish.git"
},
"scripts": {
"lint": "prettier --single-quote --write **/*.js && eslint --fix .",
Expand Down