UNPKG

electron-lisenser

Version:
69 lines (67 loc) 2.61 kB
import * as client from "lisenser"; /** * An instance of the `Lisenser` class is used to manage * the license status of an Electron app. */ export class Lisenser { /** * The product ID of the app. */ productId: string; /** * The name of the app. */ appName: string; /** * Initializes a new instance of the `Lisenser` class. * * @param productId The product ID of the app. * @param appName The name of the app. * @param machineId A unique identifier for the machine running the app. * If not provided, a machine ID will be generated using the `machine-digest` package. */ constructor(productId: string, appName?: string, machineId?: string); /** * Returns the status of the license key. If no license key is stored locally, returns `no-key`. * * @returns {Promise<client.LicenseStatus>} The status of the license key */ getLicenseStatus(): Promise<client.LicenseStatus>; /** * Activates the given license key. * * @param {string} licenseKey The license key to activate * @returns {Promise<client.LicenseStatus>} The status of the license key */ activateLicenseKey(licenseKey: string): Promise<client.LicenseStatus>; /** * Activates the trial for this product. * * @returns {Promise<client.TrialActivationStatus>} The status of the trial activation */ startTrial(): Promise<client.TrialActivationStatus>; /** * Returns the status of the trial for this product. * * @returns {Promise<client.TrialStatus>} The status of the trial */ getTrialStatus(): Promise<client.TrialStatus>; /** * Generates a third party token for the given license. * @param req The license request. * @returns {Promise<string>} The token generated */ generate3rdPartyToken(): Promise<string>; createOtpWindow(iconPath: string, appName: string, licenseKey: string): Promise<void>; /** * Creates a window that prompts the user to enter a license key. * * @param {string} iconPath The file path to the app's icon * @param {string} urlToBuy The URL where the user can purchase a license key * @param {string} [overrideAppName] An optional name to override the app's default name * @param {boolean} [setMenu=true] Whether to allow Lisenser replace the menu for the app or not. * @returns {Promise<void>} */ createLicenseKeyWindow(iconPath: string, urlToBuy: string, overrideAppName?: string, setMenu?: boolean): Promise<boolean>; } //# sourceMappingURL=types.d.ts.map