diff --git a/package.json b/package.json index 7f18233..579f50e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "description": "Programmatically install NPM dependencies to the project!", "repository": "nuxt/lmify", + "typings": "types/lmify.d.ts", "main": "dist/lmify.js", "files": [ "dist" @@ -23,6 +24,7 @@ "devDependencies": { "@babel/preset-env": "^7.4.2", "@nuxtjs/eslint-config": "^0.0.1", + "@types/execa": "^0.9.0", "babel-jest": "^24.5.0", "bili": "^4.7.2", "codecov": "^3.2.0", diff --git a/types/lmify.d.ts b/types/lmify.d.ts new file mode 100644 index 0000000..c818582 --- /dev/null +++ b/types/lmify.d.ts @@ -0,0 +1,23 @@ +import * as execa from 'execa' + +declare class Lmify { + + // for initalize + init(): void + private _init(): Promise + + // options + setPackageManager(name: 'npm' | 'yarn'): void + setRootDir(): void + + // permissions + addGranter(granter: () => Promise): void + _grant(packages: string): Promise + + // commands + install(packages: string[]): Promise | execa.ExecaReturns +} + +declare module 'lmify' { + export default Lmify +} diff --git a/yarn.lock b/yarn.lock index 9a10cb9..f8376d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -836,6 +836,13 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/execa@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@types/execa/-/execa-0.9.0.tgz#9b025d2755f17e80beaf9368c3f4f319d8b0fb93" + integrity sha512-mgfd93RhzjYBUHHV532turHC2j4l/qxsF/PbfDmprHDEUHmNZGlDn1CEsulGK3AfsPdhkWzZQT/S/k0UGhLGsA== + dependencies: + "@types/node" "*" + "@types/istanbul-lib-coverage@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#2cc2ca41051498382b43157c8227fea60363f94a"