ts-readme-generator icon indicating copy to clipboard operation
ts-readme-generator copied to clipboard

types not considered?

Open fwilhe2 opened this issue 2 years ago • 2 comments

Hi @LinusU

very cool project, I'm considering using it on my library kalkulationsbogen.

When trying it out I noticed a few things that don't seem to work for my use-case as of now.

Given this type definitions file

export declare type spreadsheetInput = row[];
export declare type row = cell[];
export declare type cell = complexCell | formulaCell | string;
export declare type complexCell = cellWithValue & cellWithRange;
export declare type formulaCell = cellWithFunction & cellWithRange;
declare type cellWithValue = {
    value: string;
    valueType?: valueType;
};
declare type cellWithFunction = {
    functionName: string;
    arguments: string[] | string;
};
declare type cellWithRange = {
    range?: string;
};
export declare type valueType = "string" | "float" | "date" | "time" | "currency" | "percentage";
export declare type spreadsheetOutput = string;
/**
 * Build a spreadsheet from data
 * @param spreadsheet list of lists of cells
 * @returns string Flat OpenDocument Spreadsheet document
 */
export declare function buildSpreadsheet(spreadsheet: spreadsheetInput): Promise<string>;
declare type addressAbsolute = "none" | "column" | "row" | "columnAndRow";
/**
 * Return "A1" style cell address given one-indexed column and row number
 * @param column one-indexed column number
 * @param row one-indexed row number
 * @param absolute specify if column, row, both or none are prefixed with '$' to indicate they are absolute
 * @returns String like 'A1' or 'C7'
 */
export declare function A1(column: number, row: number, absolute?: addressAbsolute): string;
export declare function columnIndex(i: number): string;
export {};

I get this api description

### `buildSpreadsheet(spreadsheet)`

- `spreadsheet` (`spreadsheetInput`, required) - list of lists of cells
- returns `Promise<string>` - string Flat OpenDocument Spreadsheet document

Build a spreadsheet from data

### `A1(column, row[, absolute])`

- `column` (`number`, required) - one-indexed column number
- `row` (`number`, required) - one-indexed row number
- `absolute` (`addressAbsolute`, optional) - specify if column, row, both or none are prefixed with '$' to indicate they are absolute
- returns `string` - String like 'A1' or 'C7'

Return "A1" style cell address given one-indexed column and row number

### `columnIndex(i)`

- `i` (`number`, required)
- returns `string`

Question: Are the types omitted on purpose or is this not yet implemented?

Also I'd appreciate if the name/path of the readme.md file and index.d.ts could be configured on the command line so they don't need to be in the root dir.

I might be able to contribute parts of those features if that's ok and I find the time to do that.

Best, Florian

fwilhe2 avatar Oct 08 '22 18:10 fwilhe2