Skip to content

Class App<AppProps> ​

Source: app.tsx

An application that can be ran by ProzillaOS.

Applications can be installed by adding them to AppsConfig.apps.

Type Parameters ​

AppProps ​

AppProps extends WindowProps = WindowProps

The props of the windowContent of this app.

Constructors ​

Constructor ​

new App<AppProps>(name: string, id: string, windowContent: FC<AppProps> | null, windowOptions?: Partial<AppProps> & DefaultWindowOptions): App<AppProps>

Parameters ​

name ​

string

id ​

string

windowContent ​

FC<AppProps> | null

windowOptions? ​

Partial<AppProps> & DefaultWindowOptions

Returns ​

App<AppProps>

Properties ​

name ​

name: string = "App"

The display name of this application.


id ​

id: string = "app"

The unique ID of this application.


windowContent ​

windowContent: FC<AppProps> | null

Main component that renders this app inside a window.


windowOptions? ​

optional windowOptions?: Partial<AppProps> & DefaultWindowOptions

Default options that get passed to the App.windowContent component.


description ​

description: string | null = null

Description of this application.


iconUrl ​

iconUrl: string | null = null

URL of the icon of this application.


role ​

role: string | null = null

Defines what the app can handle and how it can be used elsewhere in the system.


associatedExtensions ​

associatedExtensions: string[] = []

An array of file extensions that this application can interpret.


pinnedByDefault ​

pinnedByDefault: boolean = true

Determines whether the app is pinned by default.

Default ​

tsx
true

launchAtStartup ​

launchAtStartup: boolean = false

Determines whether the app is launched at startup.

Default ​

tsx
false

category ​

category: "Business" | "Developer tools" | "Education" | "Entertainment" | "Food & dining" | "Health & fitness" | "Kids & family" | "Lifestyle" | "Media" | "Medical" | "Multimedia design" | "Music" | "Navigation & maps" | "News & weather" | "Personal finance" | "Personalization" | "Photo & video" | "Productivity" | "Security" | "Shopping" | "Social" | "Sports" | "Travel" | "Utilities & tools" | null = null

The category the app belongs to.


metadata ​

metadata: AppMetadata | null = null

Metadata of the app's package.


showDesktopIcon ​

showDesktopIcon: boolean = false

Determines whether a desktop icon is added to the default data.

Default ​

tsx
false

isActive ​

isActive: boolean = false


isPinned? ​

optional isPinned?: boolean


isInstalled ​

isInstalled: boolean = true

Methods ​

WindowContent() ​

WindowContent(props: AppProps): Element | null

Returns the component that renders the content of a window for this app.

Parameters ​

props ​

AppProps

Returns ​

Element | null


setName() ​

setName(name: string): this

Sets the display name of this application.

Parameters ​

name ​

string

Returns ​

this


setDescription() ​

setDescription(description: string | null): this

Sets the description of this application.

Parameters ​

description ​

string | null

Returns ​

this


setIconUrl() ​

setIconUrl(iconUrl: string | null): this

Sets the URL of the icon of this application.

Parameters ​

iconUrl ​

string | null

Returns ​

this


setRole() ​

setRole(role: string | null): this

Sets the role of this application.

Parameters ​

role ​

string | null

Returns ​

this


setAssociatedExtensions() ​

setAssociatedExtensions(extensions: string[] | null): this

Sets the associated extensions of this application.

Parameters ​

extensions ​

string[] | null

Returns ​

this


setPinnedByDefault() ​

setPinnedByDefault(pinnedByDefault: boolean): this

Changes whether this application is pinned by default or not.

Parameters ​

pinnedByDefault ​

boolean

Returns ​

this


setLaunchAtStartup() ​

setLaunchAtStartup(launchAtStartup: boolean): this

Changes whether this application is launched at startup or not.

Parameters ​

launchAtStartup ​

boolean

Returns ​

this


setInstalled() ​

setInstalled(installed: boolean): this

Changes whether this application is installed by default or not.

Parameters ​

installed ​

boolean

Returns ​

this


setCategory() ​

setCategory(category: "Business" | "Developer tools" | "Education" | "Entertainment" | "Food & dining" | "Health & fitness" | "Kids & family" | "Lifestyle" | "Media" | "Medical" | "Multimedia design" | "Music" | "Navigation & maps" | "News & weather" | "Personal finance" | "Personalization" | "Photo & video" | "Productivity" | "Security" | "Shopping" | "Social" | "Sports" | "Travel" | "Utilities & tools" | null): this

Sets the category this application belongs to.

Parameters ​

category ​

"Business" | "Developer tools" | "Education" | "Entertainment" | "Food & dining" | "Health & fitness" | "Kids & family" | "Lifestyle" | "Media" | "Medical" | "Multimedia design" | "Music" | "Navigation & maps" | "News & weather" | "Personal finance" | "Personalization" | "Photo & video" | "Productivity" | "Security" | "Shopping" | "Social" | "Sports" | "Travel" | "Utilities & tools" | null

Returns ​

this


setMetadata() ​

setMetadata(metadata: AppMetadata | null): this

Sets the metadata for this application.

Parameters ​

metadata ​

AppMetadata | null

Returns ​

this


setShowDesktopIcon() ​

setShowDesktopIcon(showDesktopIcon: boolean): this

Changes whether this application has a desktop icon in the default data.

Parameters ​

showDesktopIcon ​

boolean

Returns ​

this


setWindowOptions() ​

setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this

Sets the default options for the App.windowContent component.

Parameters ​

windowOptions ​

Partial<AppProps> & DefaultWindowOptions

Returns ​

this

Built by Prozilla