Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

feat: add type definitions #8

Merged
merged 2 commits into from
Jun 4, 2019
Merged
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions types/lmify.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as execa from 'execa'

declare class Lmify {

// for initalize
init(): void
private _init(): Promise<void>

// options
setPackageManager(name: 'npm' | 'yarn'): void
setRootDir(): void

// permissions
addGranter(granter: () => Promise<boolean>): void
_grant(packages: string): Promise<boolean>

// commands
install(packages: string[]): Promise<void> | execa.ExecaReturns
}

declare module 'lmify' {
export default Lmify
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down