Cleaning up os 'app' launching, apps always return a function that takes a size for their window

This commit is contained in:
Dustin Swan 2026-02-21 22:40:40 -07:00
parent 12a22cf55c
commit eccc14a714
No known key found for this signature in database
GPG key ID: 30D46587E2100467
4 changed files with 22 additions and 16 deletions

View file

@ -41,7 +41,7 @@ export const _rt = {
clip: (config: any) => ({ kind: 'clip', ...config }),
opacity: (config: any) => ({ kind: 'opacity', ...config }),
stateful: (config: any) => ({ kind: 'stateful', ...config }),
measure: (config: any) => ({ kind: 'measure', ...config }),
measure: measure,
measureText: (text: string) => {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
@ -53,8 +53,6 @@ export const _rt = {
},
},
measure: measure,
batch: (events: any[]) => ({ _tag: 'Batch', _0: events }),
noOp: { _tag: 'NoOp' },
focus: (key: string) => ({ _tag: 'Focus', _0: key }),
@ -95,6 +93,7 @@ export const _rt = {
hasField: (field: string) => (obj: any) => ({
_tag: (typeof obj === 'object' && obj !== null && field in obj) ? 'True' : 'False'
}),
isFunction: (v: any) => ({ _tag: typeof v === 'function' ? 'True' : 'False' }),
storeSearch: (query: string) => {
return Object.keys(store)
.filter(name => _rt.fuzzyMatch(query)(name)._tag === 'True')