Interface: Project
The Project component represents the project itself. It is not represented visually. It has a list of all the Pages in the project
Hierarchy
-
↳
Project
Properties
componentType
• Readonly
componentType: string
The component's type. E.g. "View", "Text", "Button", "Page", etc.
Inherited from
currentPage
• Readonly
currentPage: Page
The currently active, visible page.
id
• Readonly
id: number
Every Component is assigned a unique numerical id that cannot be changed.
Components can be looked up by id using the get
function.
Inherited from
info
• Readonly
info: ProjectInfo
Project information.
name
• name: undefined
| string
Every Component can have a user-assigned name. It can be anything and is not guaranteed to be unique.
Components can be looked up by name using the get
function.
Inherited from
pages
• Readonly
pages: Page
[]
The pages in the project.
scrollLeft
• scrollLeft: number
The number of pixels that a Container's content is scrolled horizontally.
Inherited from
scrollTop
• scrollTop: number
The number of pixels that a Container's content is scrolled vertically.
Inherited from
viewportHeight
• Readonly
viewportHeight: number
The height of the browser viewport (window interior) in pixels.
viewportWidth
• Readonly
viewportWidth: number
The width of the browser viewport (window interior) in pixels.
Methods
clone
▸ clone(): Project
Create an exact duplicate of a component.
The clone must be added to a container with appendChild
to be visible.
Returns
Example
const clone = view.clone();
clone.x = 100;
clone.y = 100;
view.page.appendChild(clone);
Overrides
dispatchEvent
▸ dispatchEvent(event
): Promise
(opens in a new tab)<void
>
Triggers the event listeners for the specified event.
Parameters
Name | Type |
---|---|
event | Event (opens in a new tab) |
Returns
Promise
(opens in a new tab)<void
>
Inherited from
on
▸ on<K
>(type
, listener
, options?
): () => void
Add an event listener to the component.
Type parameters
Name | Type |
---|---|
K | extends keyof EventHandlersEventMap |
Parameters
Name | Type |
---|---|
type | K |
listener | (event : EventHandlersEventMap [K ]) => any |
options? | EventListenerOptions |
Returns
fn
Returns a function that removes the event listener.
▸ (): void
Add an event listener to the component.
Returns
void
Returns a function that removes the event listener.
Inherited from
submit
▸ submit(serviceId
, data
): Promise
(opens in a new tab)<void
>
Submit data to a project service
Parameters
Name | Type |
---|---|
serviceId | string |
data | Record (opens in a new tab)<string , string | number | boolean | Date (opens in a new tab)> |