@excel-builder-vanilla/types
Advanced tools
Comparing version 3.0.8 to 3.0.9
@@ -1,42 +0,2 @@ | ||
import { ZipOptions } from 'fflate'; | ||
import { Workbook } from './Excel/Workbook'; | ||
type InferOutputByType<T extends 'Blob' | 'Uint8Array'> = T extends 'Blob' ? Blob : T extends 'Uint8Array' ? Uint8Array : any; | ||
/** | ||
* Creates a new workbook. | ||
*/ | ||
export declare function createWorkbook(): Workbook; | ||
/** | ||
* Turns a workbook into a downloadable file, you can between a 'Blob' or 'Uint8Array', | ||
* and if nothing is provided then 'Blob' will be the default | ||
* @param {Excel/Workbook} workbook - The workbook that is being converted | ||
* @param {'Uint8Array' | 'Blob'} [outputType='Blob'] - defaults to 'Blob' | ||
* @param {Object} [options] | ||
* - `fileFormat` defaults to "xlsx" | ||
* - `mimeType`: a mime type can be provided by the user or auto-detect the mime when undefined (by file extension .xls/.xlsx) | ||
* (user can pass an empty string to completely cancel the mime type altogether) | ||
* - `zipOptions` to specify any `fflate` options to modify how the zip is created. | ||
* @returns {Promise} | ||
*/ | ||
export declare function createExcelFile<T extends 'Blob' | 'Uint8Array' = 'Blob'>(workbook: Workbook, outputType?: T, options?: { | ||
fileFormat?: 'xls' | 'xlsx'; | ||
mimeType?: string; | ||
zipOptions?: ZipOptions; | ||
}): Promise<InferOutputByType<T>>; | ||
/** | ||
* Download Excel file, currently only supports a "browser" as `downloadType` | ||
* but it could be expended in the future to also other type of platform like NodeJS for example. | ||
* @param {Workbook} workbook | ||
* @param {String} filename - filename (must also include file extension, xls/xlsx) | ||
* @param {Object} [options] | ||
* - `downloadType`: download type (browser/node), currently only a "browser" download as a Blob | ||
* - `mimeType`: a mime type can be provided by the user or auto-detect the mime when undefined (by file extension .xls/.xlsx) | ||
* (user can pass an empty string to completely cancel the mime type altogether) | ||
* - `zipOptions` to specify any `fflate` options to modify how the zip is created. | ||
*/ | ||
export declare function downloadExcelFile(workbook: Workbook, filename: string, options?: { | ||
downloadType?: 'browser' | 'node'; | ||
mimeType?: string; | ||
zipOptions?: ZipOptions; | ||
}): Promise<void>; | ||
export {}; | ||
//# sourceMappingURL=factory.d.ts.map | ||
import 'fflate'; | ||
export { i as createExcelFile, h as createWorkbook, j as downloadExcelFile } from './factory-DYFe0uas.js'; |
@@ -1,5 +0,79 @@ | ||
export * from './Excel'; | ||
export * from './factory'; | ||
export * from './interfaces'; | ||
export * from './utilities'; | ||
//# sourceMappingURL=index.d.ts.map | ||
export { A as AbsoluteAnchor, C as Chart, D as Drawing, a as Drawings, k as ExcelAlignmentStyle, l as ExcelBorderLineStyle, m as ExcelBorderStyle, E as ExcelColorStyle, n as ExcelColumn, o as ExcelColumnFormat, t as ExcelColumnMetadata, q as ExcelFillStyle, r as ExcelFontStyle, u as ExcelMargin, s as ExcelMetadata, v as ExcelSortState, w as ExcelStyleInstruction, p as ExcelTableColumn, O as OneCellAnchor, b as Pane, P as Picture, R as RelationshipManager, S as SharedStrings, c as SheetView, d as StyleSheet, e as Table, T as TwoCellAnchor, U as Util, W as Workbook, f as Worksheet, X as XMLDOM, g as XMLNode, i as createExcelFile, h as createWorkbook, j as downloadExcelFile } from './factory-DYFe0uas.js'; | ||
import 'fflate'; | ||
/** | ||
* This is mostly a global spot where all of the relationship managers can get and set | ||
* path information from/to. | ||
* @module Excel/Paths | ||
*/ | ||
declare const Paths: { | ||
[path: string]: string; | ||
}; | ||
/** | ||
* Converts pixel sizes to 'EMU's, which is what Open XML uses. | ||
* | ||
* @todo clean this up. Code borrowed from http://polymathprogrammer.com/2009/10/22/english-metric-units-and-open-xml/, | ||
* but not sure that it's going to be as accurate as it needs to be. | ||
* | ||
* @param int pixels | ||
* @returns int | ||
*/ | ||
declare class Positioning { | ||
static pixelsToEMUs(pixels: number): number; | ||
} | ||
/** | ||
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their | ||
* corresponding HTML entities. | ||
* | ||
* **Note:** No other characters are escaped. To escape additional | ||
* characters use a third-party library like [_he_](https://mths.be/he). | ||
* | ||
* Though the ">" character is escaped for symmetry, characters like | ||
* ">" and "/" don't need escaping in HTML and have no special meaning | ||
* unless they're part of a tag or unquoted attribute value. See | ||
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) | ||
* (under "semi-related fun fact") for more details. | ||
* | ||
* When working with HTML you should always | ||
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce | ||
* XSS vectors. | ||
* | ||
* @since 0.1.0 | ||
* @category String | ||
* @param {string} [str=''] The string to escape. | ||
* @returns {string} Returns the escaped string. | ||
* @see escapeRegExp, unescape | ||
* @example | ||
* | ||
* escape('fred, barney, & pebbles') | ||
* // => 'fred, barney, & pebbles' | ||
*/ | ||
declare const htmlEscape: (str: string) => string; | ||
declare function isObject(value: unknown): value is object; | ||
declare function isPlainObject(value: unknown): boolean; | ||
declare function isString(value: any): value is string; | ||
declare function pick(object: any, keys: string[]): any; | ||
/** | ||
* Generates a unique ID. If `prefix` is given, the ID is appended to it. | ||
* | ||
* @since 0.1.0 | ||
* @category Util | ||
* @param {string} [prefix=''] The value to prefix the ID with. | ||
* @returns {string} Returns the unique ID. | ||
* @see random | ||
* @example | ||
* | ||
* uniqueId('contact_') | ||
* // => 'contact_104' | ||
* | ||
* uniqueId() | ||
* // => '105' | ||
*/ | ||
declare function uniqueId(prefix?: string): string; | ||
export { Paths, Positioning, htmlEscape, isObject, isPlainObject, isString, pick, uniqueId }; |
{ | ||
"name": "@excel-builder-vanilla/types", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"description": "excel-builder-vanilla types", | ||
@@ -18,3 +18,3 @@ "author": "Stephen Liberty", | ||
"type": "git", | ||
"url": "https://github.com/ghiscoding/excel-builder-vanilla.git", | ||
"url": "git+https://github.com/ghiscoding/excel-builder-vanilla.git", | ||
"directory": "packages/excel-builder-vanilla-types" | ||
@@ -25,4 +25,4 @@ }, | ||
}, | ||
"type": "module", | ||
"main": "./dist/excel-builder.mjs", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
@@ -33,3 +33,7 @@ "exports": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/excel-builder.mjs" | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.cts", | ||
"default": "./dist/index.cjs" | ||
} | ||
@@ -47,3 +51,3 @@ }, | ||
}, | ||
"gitHead": "4904941f7a473bb7a854660fce519a90a134ecb5" | ||
"gitHead": "0912be6a46a43beb32437d96dcd01e2881eab4cb" | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
69662
10
1062
1
No