-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
189 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ vsc-extension-quickstart.md | |
**/*.map | ||
**/*.ts | ||
.github | ||
typings |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './fieldTypes'; | ||
export * from './attrType'; | ||
export * from './importRule'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"checkJs": true, | ||
"alwaysStrict": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
// Generated by dts-bundle v0.7.3 | ||
|
||
declare module 'y3helper' { | ||
export * from 'y3helper/fieldTypes'; | ||
export * from 'y3helper/attrType'; | ||
export * from 'y3helper/importRule'; | ||
} | ||
|
||
declare module 'y3helper/fieldTypes' { | ||
export const enum FieldType { | ||
Default = 0, | ||
Int = 1, | ||
Str = 2, | ||
Bool = 3, | ||
Float = 4, | ||
RatiosInt = 5, | ||
RatiosFloat = 6, | ||
List = 7, | ||
Templete = 8, | ||
Tuple = 9, | ||
EnumInt = 10, | ||
EnumStr = 11, | ||
Enum = 12 | ||
} | ||
export class converter { | ||
type: FieldType; | ||
defaultValue: any; | ||
constructor(); | ||
getDefault(): any; | ||
getTypeDesc(): string; | ||
getErrorStr(data: any): string; | ||
inputConvert(data: any): any; | ||
outputConvert(d: any): any; | ||
static getInstance(): any; | ||
} | ||
export class IntKlass extends converter { | ||
type: FieldType; | ||
defaultValue: number; | ||
constructor(defaultValue?: number | string); | ||
getDefault(): number; | ||
inputConvert(data: any): any; | ||
} | ||
export class StrKlass extends converter { | ||
type: FieldType; | ||
defaultValue: string; | ||
constructor(defaultValue?: any); | ||
getDefault(): string; | ||
inputConvert(data: any): any; | ||
} | ||
export class BoolenKlass extends converter { | ||
type: FieldType; | ||
defaultValue: boolean; | ||
constructor(defaultValue?: any); | ||
getDefault(): boolean; | ||
inputConvert(data: any): boolean; | ||
} | ||
export class FloatKlass extends converter { | ||
type: FieldType; | ||
defaultValue: number; | ||
constructor(defaultValue?: any); | ||
getDefault(): number; | ||
inputConvert(data: any): any; | ||
} | ||
export class RatiosIntKlass extends converter { | ||
type: FieldType; | ||
defaultValue: number; | ||
ratios: number; | ||
constructor(ratios?: number, defaultValue?: any); | ||
getDefault(): number; | ||
inputConvert(data: any): any; | ||
} | ||
export class RatiosFloatKlass extends converter { | ||
type: FieldType; | ||
defaultValue: number; | ||
ratios: number; | ||
constructor(ratios?: number, defaultValue?: any); | ||
getDefault(): number; | ||
inputConvert(data: any): any; | ||
} | ||
export class ListKlass extends converter { | ||
type: FieldType; | ||
seperator: string; | ||
ft: converter; | ||
constructor(seperator?: string, filedType?: Function | converter); | ||
getDefault(): []; | ||
inputConvert(data: any): any[]; | ||
} | ||
export class TupleKlass extends converter { | ||
type: FieldType; | ||
seperator: string; | ||
ftList: Function[] | converter[]; | ||
constructor(seperator: string, args: Function[] | converter[]); | ||
inputConvert(data: any): any[]; | ||
} | ||
export class EnumKlass extends converter { | ||
type: FieldType; | ||
enumMap: { | ||
[key: string]: any; | ||
}; | ||
constructor(map: { | ||
[key: string]: any; | ||
}); | ||
inputConvert(data: any): any; | ||
} | ||
export class TempleteKlass extends converter { | ||
type: FieldType; | ||
getDefault(): any; | ||
inputConvert(data: any): any; | ||
} | ||
export function Int(value: any): IntKlass; | ||
export function Float(value: any): FloatKlass; | ||
export function Str(value: any): StrKlass; | ||
export function Bool(value: any): BoolenKlass; | ||
export function Templete(): TempleteKlass; | ||
export function List(seperator: any, type: Function): ListKlass; | ||
export function Tuple(seperator?: string, ...args: Function[] | converter[]): TupleKlass; | ||
export function Enum(map: {}): EnumKlass; | ||
export function RatiosInt(retios?: any, value?: any): RatiosIntKlass; | ||
export function RatiosFloat(retios?: any, value?: any): RatiosFloatKlass; | ||
} | ||
|
||
declare module 'y3helper/attrType' { | ||
export class AttrKlass { | ||
constructor(name: any, desc?: string); | ||
getString(): string; | ||
} | ||
export const NONE: AttrKlass; | ||
export const INDEX: AttrKlass; | ||
export const DEFAULT: AttrKlass; | ||
export const IGNORE: AttrKlass; | ||
export const REQUIRED: AttrKlass; | ||
export const CONST: AttrKlass; | ||
export const SKIPNULL: AttrKlass; | ||
export function AS(outKey: string | number, asType: as): as; | ||
export class as { | ||
outKey: string | number; | ||
asType: any; | ||
constructor(outKey: string | number, asType: as); | ||
} | ||
} | ||
|
||
declare module 'y3helper/importRule' { | ||
export class ImportRule { | ||
editorTableType: string; | ||
excelRelativePath: string; | ||
sheet: string; | ||
fieldDefs: { | ||
[key: string]: [string | string[] | number[], any, any]; | ||
}; | ||
filter: Function | undefined; | ||
jumpHeader: number; | ||
dataRehandle: Function | undefined; | ||
constructor(editorTableType: string, excelRelativePath: string, sheetName: string); | ||
resetRule(editorTableType: string, excelRelativePath: string, sheetName: string): void; | ||
def(fieldName: string, filedKey: string | string[] | number[], fieldType: any, attrType: any): void; | ||
templateBy(fieldName: string): void; | ||
indexBy(fieldName: string): void; | ||
startBy(jumpHeader: number): void; | ||
copyRule(): ImportRule; | ||
deepCopy(obj: any): any; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
tsc -d src\editorTable\EXCEL\index.ts --emitDeclarationOnly --outDir ./tmp/typings | ||
dts-bundle --name y3helper --main tmp\typings\index.d.ts --out y3helper.d.ts | ||
xcopy /y .tmp\typings\y3helper.d.ts .\template\excel\rules\y3helper.d.ts | ||
pause |