mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add new definitions for [@types/splitpanes] (#36364)
* Add types of [@types/vue-splitpane] package * Add types of [@types/vue-splitpane] package * update split type * fix EsLint Missing semicolon * fix Eslint Missing semicolon * fix esLint * fix Eslint * Add types of [@types/splitpanes] package * fix file rename * fix Submit multiple components at a PR * fix rename * fix build rename * Add new definitions for [@types/splitpanes] * fix tsconfig files list * fix tsconfig files name * fix eslint * fix bug dt-header add object-literal-key-quotes * fix Consecutive * fix stander name
This commit is contained in:
parent
47c71265ab
commit
84f0283b53
85
types/splitpanes/index.d.ts
vendored
Normal file
85
types/splitpanes/index.d.ts
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
// Type definitions for splitPanes 1.0
|
||||
// Project: https://github.com/antoniandre/splitpanes
|
||||
// Definitions by: teenhe <https://github.com/noonhorse>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.5
|
||||
import { VueConstructor } from 'vue';
|
||||
|
||||
export default splitPanes;
|
||||
export const splitPanes: splitPanesConstructor;
|
||||
|
||||
export interface positionTypes {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export interface containerTypes {
|
||||
vnode: any;
|
||||
offsetLeft: null | number;
|
||||
offsetTop: null | number;
|
||||
}
|
||||
export interface touchTypes {
|
||||
mouseDown: boolean;
|
||||
dragging: boolean;
|
||||
activeSplitter: null | number;
|
||||
}
|
||||
|
||||
export interface splitterTapsTypes {
|
||||
splitter: null | number;
|
||||
timeoutId: null | object;
|
||||
}
|
||||
|
||||
export interface splitPanesProps {
|
||||
watchSlots: boolean; // 是否监控插槽 false
|
||||
horizontal: boolean; // 是否水平 false
|
||||
pushOtherPanes: boolean; // 支持添加 true
|
||||
dblClickSplitter: boolean; // 双击分离 true
|
||||
}
|
||||
|
||||
export interface splitPanesData {
|
||||
container: containerTypes;
|
||||
slotsCount: number;
|
||||
vnodes: any[];
|
||||
panes: any[];
|
||||
splitters: any[];
|
||||
touch: touchTypes;
|
||||
// Detect double click on touch devices.
|
||||
splitterTaps: splitterTapsTypes;
|
||||
slotsCopy: string;
|
||||
}
|
||||
|
||||
export interface splitPanesWatch {
|
||||
defaultPercent: (val: any) => void;
|
||||
}
|
||||
|
||||
export interface splitPanesMethods {
|
||||
bindEvents: () => void;
|
||||
onMouseDown: (e: Event, splitterIndex: number) => void;
|
||||
onMouseMove: (e: Event) => void;
|
||||
onMouseUp: () => void;
|
||||
onSplitterClick: (e: Event, splitterIndex: number) => void;
|
||||
onSplitterDblClick: (e: Event, splitterIndex: number) => void;
|
||||
getCurrentMouseDrag: (e: Event) => positionTypes;
|
||||
getCurrentDragPercentage: (drag: object) => number;
|
||||
calculatePanesSize: (drag: object) => boolean | void;
|
||||
doPushOtherPanes: (sums: object, dragPercentage: number) => any;
|
||||
sumPrevPanesSize: (splitterIndex: number) => object;
|
||||
sumNextPanesSize: (splitterIndex: number) => object;
|
||||
findPrevExpandedPane: (splitterIndex: number) => object;
|
||||
findNextExpandedPane: (splitterIndex: number) => object;
|
||||
}
|
||||
|
||||
export interface splitPanesComputed {
|
||||
defaultWidth: () => number;
|
||||
}
|
||||
|
||||
export interface splitPanesConstructor extends VueConstructor {
|
||||
props: splitPanesProps;
|
||||
data: () => splitPanesData;
|
||||
watch: splitPanesWatch;
|
||||
methods: splitPanesMethods;
|
||||
computed: splitPanesComputed;
|
||||
mounted: () => void;
|
||||
beforeDestroy: () => void;
|
||||
beforeUpdate: () => void;
|
||||
render: (createEl: any) => any;
|
||||
}
|
||||
6
types/splitpanes/package.json
Normal file
6
types/splitpanes/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vue": ">=2.0.0"
|
||||
}
|
||||
}
|
||||
17
types/splitpanes/splitpanes-tests.ts
Normal file
17
types/splitpanes/splitpanes-tests.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import Vue from 'vue';
|
||||
import splitPanes from 'splitpanes';
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {},
|
||||
components: {
|
||||
'split-panes': splitPanes,
|
||||
},
|
||||
template: `<split-panes class="default-theme" horizontal @resize="horizontalResize($event)" :dblClickSplitter="false" :push-other-panes="false">
|
||||
<span splitpanes-min="2" splitpanes-size="35" splitpanes-max="85">
|
||||
A
|
||||
</span>
|
||||
<span splitpanes-min="2" splitpanes-size="65" splitpanes-max="85">
|
||||
B
|
||||
</span>
|
||||
</split-panes>`,
|
||||
});
|
||||
16
types/splitpanes/tsconfig.json
Normal file
16
types/splitpanes/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "splitpanes-tests.ts"]
|
||||
}
|
||||
1
types/splitpanes/tslint.json
Normal file
1
types/splitpanes/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
49
types/vue-splitpane/index.d.ts
vendored
Normal file
49
types/vue-splitpane/index.d.ts
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
// Type definitions for vue-splitpane 1.0
|
||||
// Project: https://github.com/PanJiaChen/vue-split-pane/
|
||||
// Definitions by: noonhorse <https://github.com/noonhorse>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.5
|
||||
import { VueConstructor } from 'vue';
|
||||
|
||||
export default Splitpane;
|
||||
export const Splitpane: SplitpaneConstructor;
|
||||
|
||||
export interface SplitpaneProps {
|
||||
minPercent: number;
|
||||
defaultPercent: number;
|
||||
split: string; // = ['vertical', 'horizontal']
|
||||
className: string;
|
||||
}
|
||||
|
||||
export interface SplitpaneData {
|
||||
active: boolean;
|
||||
hasMoved: boolean;
|
||||
height: any; // null number string
|
||||
percent: number;
|
||||
type: string;
|
||||
resizeType: string;
|
||||
}
|
||||
|
||||
export interface SplitpaneWatch {
|
||||
defaultPercent: (val: any) => void;
|
||||
}
|
||||
|
||||
export interface SplitpaneMethods {
|
||||
onClick: () => void;
|
||||
onMouseDown: () => void;
|
||||
onMouseUp: () => void;
|
||||
onMouseMove: (e: Event) => void;
|
||||
}
|
||||
|
||||
export interface SplitpaneComputed {
|
||||
userSelect: () => string;
|
||||
cursor: () => string;
|
||||
}
|
||||
|
||||
export interface SplitpaneConstructor extends VueConstructor {
|
||||
props: SplitpaneProps;
|
||||
data: () => SplitpaneData;
|
||||
watch: SplitpaneWatch;
|
||||
methods: SplitpaneMethods;
|
||||
computed: SplitpaneComputed;
|
||||
}
|
||||
6
types/vue-splitpane/package.json
Normal file
6
types/vue-splitpane/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vue": ">=2.0.0"
|
||||
}
|
||||
}
|
||||
16
types/vue-splitpane/tsconfig.json
Normal file
16
types/vue-splitpane/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "vue-splitpane-tests.ts"]
|
||||
}
|
||||
1
types/vue-splitpane/tslint.json
Normal file
1
types/vue-splitpane/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
17
types/vue-splitpane/vue-splitpane-tests.ts
Normal file
17
types/vue-splitpane/vue-splitpane-tests.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import Vue from 'vue';
|
||||
import splitPane from 'vue-splitpane';
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {},
|
||||
components: {
|
||||
'split-pane': splitPane,
|
||||
},
|
||||
template: `<split-pane v-on:resize="resize" :min-percent='20' :default-percent='30' split="vertical">
|
||||
<template slot="paneL">
|
||||
A
|
||||
</template>
|
||||
<template slot="paneR">
|
||||
B
|
||||
</template>
|
||||
</split-pane>`,
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user