11---
22outline : deep
33description : " An application that can be run by ProzillaOS"
4+ package : " @prozilla-os/core"
45---
56
67# Class [ ` App ` ] ( https://github.com/prozilla-os/ProzillaOS/blob/main/packages/core/src/features/system/configs/app.tsx )
78
8- An application that can be run by ProzillaOS
9+ {{ $frontmatter.description }}
910
1011Applications can be installed by adding them to the ` apps ` array in [ ` AppsConfig ` ] ( ../system/apps-config#apps-app )
1112
@@ -19,117 +20,192 @@ Applications can be installed by adding them to the `apps` array in [`AppsConfig
1920
2021### Parameters
2122
22- - ** name ** : ` string `
23+ < br >
2324
24- - ** id ** : ` string `
25+ #### name
2526
26- - ** windowContent ** : ` React.FC<AppProps> `
27+ - ** Type: ** ` string `
2728
28- - ** windowOptions ** : ` object ` (optional)
29+ #### id
2930
30- - windowOptions.size : [`Vector2`](/reference/classes/utils/vector2)
31+ - ** Type:** ` string `
32+
33+ #### windowContent
34+
35+ - ** Type:** ` React.FC<AppProps> `
36+
37+ #### windowOptions
38+
39+ - ** Optional**
40+ - ** Type:** ` WindowOptions `
41+
42+ ``` ts
43+ interface WindowOptions {
44+ size? : Vector2 ;
45+ [key : string ]: unknown ;
46+ }
47+ ```
48+
49+ > [ !NOTE] References
50+ > - [ Vector2] ( ../utils/vector2 )
3151
3252## Properties
3353
34- ### name : ` string ` {#name}
54+ ### name
55+
56+ - ** Type:** ` string `
57+ - ** Default:** ` "App" `
3558
3659The display name of this application
3760
38- > ** @default **
39- > ``` ts
40- > " App"
41- > ` ` `
61+ ### id
4262
43- ### id : ` string ` {#id}
63+ - ** Type:** ` string `
64+ - ** Default:** ` "app" `
4465
4566The unique ID of this application
4667
47- > **@default**
48- > ` ` ` ts
49- > " app"
50- > ` ` `
51-
5268> [ !WARNING]
5369> Every app must have a unique ID that only contains lower case letters (a-z), numbers (0-9) and dashes (-).
5470
55- ### windowContent : ` React .FC <AppProps >` {#window-content}
71+ ### windowContent
72+
73+ - ** Type:** ` React.FC<AppProps> `
5674
5775React component that renders this app inside a window when the app is running
5876
59- ### windowOptions : ` object ` {#window-options}
77+ ### windowOptions
78+
79+ - ** Type:** ` WindowOptions `
6080
6181Default options that get passed to the ` windowContent ` component
6282
63- You can extend this object with any properties
83+ ``` ts
84+ interface WindowOptions {
85+ size? : Vector2 ;
86+ [key : string ]: unknown ;
87+ }
88+ ```
6489
65- #### Properties
90+ > [ !NOTE] References
91+ > - [ Vector2] ( ../utils/vector2 )
6692
67- - windowOptions.size : [ ` Vector2 ` ](/reference/classes/utils/vector2)
93+ ### description
6894
69- ### description : ` string | null ` {#description}
95+ - ** Type: ** ` string | null `
7096
7197Description of this application
7298
73- ### iconUrl : ` string | null ` {#icon-url}
99+ ### iconUrl
100+
101+ - ** Type:** ` string | null `
74102
75103URL of the icon of this application
76104
77- ### role : ` string | null ` {#role}
105+ ### role
106+
107+ - ** Type:** ` string | null `
78108
79109Defines what parts of the OS this app is responsible for and how it can be used by other apps
80110
81- ### associatedExtensions : ` string []` {#associated-extensions}
111+ ### associatedExtensions
112+
113+ - ** Type:** ` string | null `
82114
83115An array of file extensions that this application is used to open and read
84116
85- ### pinnedByDefault : ` boolean ` {#pinned-by-default}
117+ ### pinnedByDefault
118+
119+ - ** Type:** ` boolean `
120+ - ** Default:** ` true `
86121
87122Determines whether the app is pinned by default
88123
89- > **@default**
90- > ` ` ` ts
91- > true
92- > ` ` `
124+ ### launchAtStartup
93125
94- ### launchAtStartup : ` boolean ` {#launch-at-startup}
126+ - ** Type:** ` boolean `
127+ - ** Default:** ` false `
95128
96129Determines whether the app is launched at startup
97130
98- > **@default**
99- > ` ` ` ts
100- > false
101- > ` ` `
102-
103131## Methods
104132
105- ### setName (name : ` string ` ) => ` this ` {#set-name}
133+ ### setName(name)
134+
135+ - ** Parameters**
136+ - ** name**
137+ - **Type:** `string`
138+ - ** Returns**
139+ - ** Type:** ` this `
106140
107141Set the display name of this application
108142
109- ### setDescription (description : ` string | null ` ) => ` this ` {#set-description}
143+ ### setDescription(description)
144+
145+ - ** Parameters**
146+ - ** description**
147+ - **Type:** `string`
148+ - ** Returns**
149+ - ** Type:** ` this `
110150
111151Set the description of this application
112152
113- ### setIconUrl (iconUrl : ` string | null ` ) => ` this ` {#set-icon-url}
153+ ### setIconUrl(iconUrl)
154+
155+ - ** Parameters**
156+ - ** iconUrl**
157+ - **Type:** `string | null`
158+ - ** Returns**
159+ - ** Type:** ` this `
114160
115161Set the URL of the icon of this application
116162
117- ### setRole (role : ` string | null ` ) => ` this ` {#set-role}
163+ ### setRole(role)
164+
165+ - ** Parameters**
166+ - ** role**
167+ - **Type:** `string | null`
168+ - ** Returns**
169+ - ** Type:** ` this `
118170
119171Set the role of this application
120172
121- ### setAssociatedExtensions (extensions : ` string [] | null ` ) => ` this ` {#set-associated-extensions}
173+ ### setAssociatedExtensions(extensions)
174+
175+ - ** Parameters**
176+ - ** extensions**
177+ - **Type:** `string[] | null`
178+ - ** Returns**
179+ - ** Type:** ` this `
122180
123181Set the associated extensions of this application
124182
125- ### setPinnedByDefault (pinnedByDefault : ` boolean ` ) => ` this ` {#set-pinned-by-default}
183+ ### setPinnedByDefault(pinnedByDefault)
184+
185+ - ** Parameters**
186+ - ** pinnedByDefault**
187+ - **Type:** `boolean`
188+ - ** Returns**
189+ - ** Type:** ` this `
126190
127191Changes whether this application is pinned by default or not
128192
129- ### setLaunchAtStartup (launchAtStartup : ` boolean ` ) => ` this ` {#set-launch-at-startup}
193+ ### setLaunchAtStartup(launchAtStartup)
194+
195+ - ** Parameters**
196+ - ** launchAtStartup**
197+ - **Type:** `boolean`
198+ - ** Returns**
199+ - ** Type:** ` this `
130200
131201Changes whether this application is launched at startup or not
132202
133- ### WindowContent (props : ` AppProps ` ) => ` React .ReactElement ` {#Window-content}
203+ ### WindowContent(props)
204+
205+ - ** Parameters**
206+ - ** props**
207+ - **Type:** `AppProps`
208+ - ** Returns**
209+ - ** Type:** ` React.ReactElement `
134210
135211Renders the app as a React component
0 commit comments