Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

Commit

Permalink
feat: add type definition (#4)
Browse files Browse the repository at this point in the history
* chore: add prettier config

* type: add type definition

* chore: upgrade version to v1.0.5

* chore: update package-lock.json
  • Loading branch information
김동우 committed Mar 27, 2019
1 parent 517fab4 commit 1121ae5
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 164 deletions.
14 changes: 0 additions & 14 deletions .eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
plugins: ['vue', 'prettier'],
extends: ['tui/es6', 'plugin:vue/base', 'plugin:prettier/recommended'],
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 7,
sourceType: 'module'
}
};
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"singleQuote": true,
"bracketSpacing": false,
"arrowParens": "always"
}
11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Vue from 'vue';
import TuiGrid from 'tui-grid';

type FunctionKeys<T extends object> = {[K in keyof T]: T[K] extends Function ? K : never}[keyof T];

type GridFnKeys = FunctionKeys<TuiGrid>;

export declare class Grid extends Vue {
invoke<T extends GridFnKeys>(fname: T, ...args: Parameters<TuiGrid[T]>): ReturnType<TuiGrid[T]>;
getRootElement(): HTMLElement;
}
82 changes: 70 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@toast-ui/vue-grid",
"version": "1.0.4",
"version": "1.0.5",
"description": "TOAST UI Grid for Vue",
"main": "dist/toastui-vue-grid.js",
"files": [
"dist",
"src"
"src",
"index.d.ts"
],
"scripts": {
"lint": "eslint src/**",
Expand All @@ -26,15 +27,20 @@
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.4",
"eslint": "^5.5.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-tui": "^2.0.0",
"eslint-loader": "^2.1.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-vue": "^4.7.1",
"vue": "^2.5.17",
"vue-loader": "^15.4.1",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.0"
},
"peerDependencies": {
"vue": "^2.5.0"
},
"dependencies": {
"tui-grid": "^3.5.0"
}
Expand Down
Loading

0 comments on commit 1121ae5

Please sign in to comment.