> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Import JSDoc ## Article: Import JSDoc ## Article Link: https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/code-editor-ide/import-jsdoc.md ## Article Content: # Set up Type Checking and Autocomplete by Importing JSDoc Types You can import JSDoc types to use in your JavaScript code. Apply a JSDoc type to a parameter to enable [type checking and autocomplete](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/code-editor-ide/using-jsdoc.md#type-checking-and-autocomplete).
Important: Importing JSDoc is supported only in the code editor, not in the Wix IDE or your local IDE.## Step 1 | Define and export a type You can skip this step if you want to use a type defined by Wix. To define and export a type using JSDoc: 1. Use [JSDoc tags and definitions](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/code-editor-ide/using-jsdoc.md#jsdoc-tags-and-definitions) to define a type. For example: ```js /** * @typedef {object} employee * @property {string} name Employee's name. * @property {string} seniority The number of years the employee has worked at the company. * @property {number} hours The number of hours the employee works a week. */ ``` 1. You can expose your type to your site's files as either a global type or a restricted type: - **Global type**: You can use your defined type in any JavaScript file without further changes. - **Restricted type**: You can define different types with the same name in different files. To restrict your type, add `export {};` below your JSDoc declaration. For example: ```js /** * @typedef {object} employee * @property {string} name Employee's name. * @property {string} seniority The number of years the employee has worked at the company. * @property {number} hours The number of hours the employee works a week. */ export {}; ``` ## Step 2 | Access a JSDoc type The way that you import the JSDoc type depends on where and how the type is exposed: - [Self-defined global type](#self-defined-global-type) - [Self-defined restricted type](#self-defined-restricted-type) - [Wix editor elements](#wix-editor-elements) - [Backend event handlers](#backend-event-handlers) - [Router functions](#router-functions) ### Self-defined global type Use the type without importing it. For example: ```js /** * @param {employee} employee */ export function salaryCalculator(employee) { return `Salary for ${employee.name}: ${employee.hours * employee.seniority * 100}`; } ``` ### Self-defined restricted type Import your type using `import('
onBookingCreatedwix-bookings.v2 event, onBookingCreated():
onBookingCreated..md Find the EventObjectName.
events.js file:/** @param {import('api-module-name').Events.BookingCreated} event */
/** @param {import('api-module-name').Events.BookingCreated} event */
export function wixBookings_onBookingCreated(event) {
// Handle your event
}