mirror of
https://github.com/optilude/xlsx-template.git
synced 2026-07-02 00:17:39 +08:00
Fix type definitions for Generate (#156)
Type definitions on typescript for output data
This commit is contained in:
Vendored
+4
-2
@@ -27,7 +27,9 @@ interface OutputByType {
|
||||
nodebuffer: Buffer;
|
||||
}
|
||||
|
||||
export type GenerateOptions = keyof OutputByType;
|
||||
export type GenerateOptions = {
|
||||
type: keyof OutputByType
|
||||
};
|
||||
|
||||
interface RangeSplit
|
||||
{
|
||||
@@ -58,7 +60,7 @@ class XlsxTemplate
|
||||
public copySheet(sheetName : string, copyName : string, binary? : boolean) : this;
|
||||
public loadTemplate(data : Buffer) : void;
|
||||
public substitute(sheetName : string | number, substitutions : Object) : void;
|
||||
public generate<T extends GenerateOptions>(options : T) : OutputByType[T];
|
||||
public generate<T extends GenerateOptions>(options : T) : OutputByType[OutputByType];
|
||||
public generate() : any;
|
||||
|
||||
public replaceString(oldString : string, newString : string) : number; // returns idx
|
||||
|
||||
Reference in New Issue
Block a user