mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-10 22:04:38 -05:00
feat: improved elm template
This commit is contained in:
parent
8545d7c1e8
commit
6b2a601776
22 changed files with 2139 additions and 0 deletions
25
templates/elm/frontend/src/interop.ts
Normal file
25
templates/elm/frontend/src/interop.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// This returns the flags passed into your Elm application
|
||||
export const flags = async ({ env } : ElmLand.FlagsArgs) => {
|
||||
return {}
|
||||
}
|
||||
|
||||
// This function is called after your Elm app starts
|
||||
export const onReady = ({ app, env } : ElmLand.OnReadyArgs) => {
|
||||
console.log('Elm is ready', app)
|
||||
}
|
||||
|
||||
|
||||
// Type definitions for Elm Land
|
||||
namespace ElmLand {
|
||||
export type FlagsArgs = {
|
||||
env: Record<string, string>
|
||||
}
|
||||
export type OnReadyArgs = {
|
||||
env: Record<string, string>
|
||||
app: { ports?: Record<string, Port> }
|
||||
}
|
||||
export type Port = {
|
||||
send?: (data: unknown) => void
|
||||
subscribe?: (callback: (data: unknown) => unknown) => void
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue