UNPKG

@sheetxl/models

Version:

Models - A Headless javascript spreadsheet library.

62 lines 2.21 kB
export interface LicenseDetails { licensee(): string | null; expiration(): Date | null; domains(): string[]; isValidFor: (feature: string) => boolean; developerCount(): number; type(): string; exceptions(): string[]; features(): Readonly<Record<string, string>>; keyFrom(): string; key(): string; } declare class BaseLicenseManager { private _bannerPrintOnLoad; private _licensePrintOnLoad; constructor(); /** * Set the license key provided by SheetXL. * @remarks * The license key can also be provided via a file named `sheetxl.lic` in the root of the web server. * * @param licenseKey the license key as a string. * @param checkSet if set to true will not give a warning if called multiple times. * @see {@link https://www.sheetxl.com/docs/getting-started/license-key | License Keys} * @returns */ setLicenseKey(licenseKey: string, checkSet?: boolean): Promise<LicenseDetails>; private _validate; /** * Will print the banner if running localhost by default * @defaultValue true if running localhost or there is no valid license key. * @param printBanner */ setPrintBannerOnLoad(printBanner: boolean): void; /** * This toggles whether the license details should print to the console on load. * * @remarks * This will always be true if the license key is not a valid commercial license. * * @defaultValue false */ setPrintLicenseDetailsOnLoad(printLicenseDetails: boolean): void; getLicenseDetails(): Promise<LicenseDetails>; printBanner(log?: any): void; private _printLicenseDetails; wasBannerPrinted(): boolean; /** * Print the current license details. */ printLicenseDetails(expanded?: boolean): void; wasLicenseInfoPrinted(): boolean; } /** * LicenseManager is used to manage license keys at runtime. * * License keys can be generated by visiting {@link https://www.sheetxl.com/docs/getting-started/license-key | License Keys}. */ declare const LicenseManager: BaseLicenseManager; export default LicenseManager; export { LicenseManager }; //# sourceMappingURL=LicenseManager.d.ts.map