import { IApiKeyResponse, ICreateApiKeyOptions } from "./shared/types/apiKeyType.js"; /** * Used to register an API key. See the [security and authentication](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/) for more information about API key. * * ```js * import { createApiKey, IApiKeyResponse } from '@esri/arcgis-rest-developer-credentials'; * import { ArcGISIdentityManager } from "@esri/arcgis-rest-request"; * * const authSession: ArcGISIdentityManager = await ArcGISIdentityManager.signIn({ * username: "xyz_usrName", * password: "xyz_pw" * }); * * const threeDaysFromToday = new Date(); * threeDaysFromToday.setDate(threeDaysFromToday.getDate() + 3); * threeDaysFromToday.setHours(23, 59, 59, 999); * * createApiKey({ * title: "xyz_title", * description: "xyz_desc", * tags: ["xyz_tag1", "xyz_tag2"], * privileges: ["premium:user:networkanalysis:routing"], * authentication: authSession, * generateToken1: true, // optional,generate a new token * apiToken1ExpirationDate: threeDaysFromToday // optional, update expiration date * }).then((registeredAPIKey: IApiKeyResponse) => { * // => {accessToken1: "xyz_key", item: {tags: ["xyz_tag1", "xyz_tag2"], ...}, ...} * }).catch(e => { * // => an exception object * }); * ``` * * @param requestOptions - Options for {@linkcode createApiKey | createApiKey()}, including necessary params to register an API key and an {@linkcode @esri/arcgis-rest-request!ArcGISIdentityManager} authentication session. * @returns A Promise that will resolve to an {@linkcode IApiKeyResponse} object representing the newly registered API key. */ export declare function createApiKey(requestOptions: ICreateApiKeyOptions): Promise;