Pause-Games/flow/flow.types
Shared Flow types: the element tree, flexbox style, component props, screen definitions and the navigation API.
- GitHub: Pause-Games/flow — pinned to
1.0.0- Pick a release from Pause-Games/flow releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as types from "flow.types"
- Pick a release from Pause-Games/flow releases and add its Source code (zip) URL (or a packaged
Types
Flow_Style
Flow_Style.width: number | string
Fixed width in px, or percentage "50%"
Flow_Style.height: number | string
Fixed height in px, or percentage "50%"
Flow_Style.min_width: number
Stored for compatibility; currently not enforced by flow/layout.lua
Flow_Style.min_height: number
Stored for compatibility; currently not enforced by flow/layout.lua
Flow_Style.max_width: number
Stored for compatibility; currently not enforced by flow/layout.lua
Flow_Style.max_height: number
Stored for compatibility; currently not enforced by flow/layout.lua
Flow_Style.flex_direction: "column" | "row"
Flow_Style.flex_grow: number
Flow_Style.flex_shrink: number
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.flex_basis: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.align_items: "start" | "center" | "end" | "stretch"
Flow_Style.align_self: "start" | "center" | "end" | "stretch" | "auto"
Flow_Style.justify_content: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly"
Flow_Style.gap: number
Flow_Style.padding: number | string
Flow_Style.padding_left: number | string
Flow_Style.padding_right: number | string
Flow_Style.padding_top: number | string
Flow_Style.padding_bottom: number | string
Flow_Style.margin: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.margin_left: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.margin_right: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.margin_top: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.margin_bottom: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.border: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.border_left: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.border_right: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.border_top: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.border_bottom: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.position_left: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.position_right: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.position_top: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.position_bottom: number | string
Stored for compatibility; currently not consumed by flow/layout.lua
Flow_Style.position_type: "static" | "relative" | "absolute"
Flow_Style.flex_wrap: "no-wrap" | "wrap" | "wrap-reverse"
Flow_Style.overflow: "visible" | "hidden" | "scroll"
Flow_Style.display: "flex" | "none"
Flow_Style.aspect_ratio: number
Flow_Style.direction: "inherit" | "ltr" | "rtl"
Flow_Element
Flow_Element.key: string
Stable unique identifier for node caching
Flow_Element.type: string
Element type ("box", "text", "button", etc.); filled by constructors like Box()/Text()/Button()
Flow_Element.style: Flow_Style
Flow_Element.children: Flow_Element[]
Flow_Element.layout: Flow_LayoutRect
Computed layout (written by layout engine)
Flow_Element.color: Flow_ColorValue
Flow_Element.scale: number | { x?: number; y?: number; z?: number }
Flow_Element.text: string
Flow_Element.align: "left" | "center" | "right"
Flow_Element.font: string
Flow_Element.line_break: boolean
Flow_Element.image: string
Flow_Element.texture: string
Flow_Element.scale_mode: "stretch" | "fit"
Flow_Element.image_aspect: number
Flow_Element.border: number | { left?: number; top?: number; right?: number; bottom?: number }
Flow_Element.pressed_color: Flow_ColorValue
Flow_Element.on_click: (element: Flow_Element) => void
Flow_Element.backdrop_color: Flow_ColorValue
Flow_Element.on_backdrop_click: (element: Flow_Element) => void
Flow_Element._visible: boolean
Flow_Element._is_overlay: boolean
Flow_Element._alpha: number
Flow_Element._offset_x: number
Flow_Element._offset_y: number
Flow_Element._offset_x_pixels: number
Flow_Element._offset_y_pixels: number
Flow_Element._pressed: boolean
Flow_Element._hovered: boolean
Flow_Element._open: boolean
Flow_Element._anim_y: number
Flow_Element._anim_velocity: number
Flow_Element._on_anim_update: (anim_y: number, velocity: number) => void
Flow_Element._sheet_height: number
Flow_Element._scrollbar: boolean
Flow_Element._bounce: boolean
Flow_Element._momentum: boolean
Flow_Element._virtual_height: number
Flow_Element._virtual_width: number
Flow_Element._scroll_y: number
Flow_Element._scroll_x: number
Flow_Element._momentum_active: boolean
Flow_Element._bouncing: boolean
Flow_Element._velocity: number
Flow_Element._dragging_axis: "x" | "y"
Flow_Element._dragging: boolean
Flow_Element._drag_start_y: number
Flow_Element._drag_start_x: number
Flow_Element._scroll_start_y: number
Flow_Element._scroll_start_x: number
Flow_Element._last_drag_y: number
Flow_Element._last_drag_x: number
Flow_Element._last_drag_time: number
Flow_Element._cache_key: string
Flow_Element._node_prefix: string
Flow_Element._background_screen: Flow_Element
Flow_Element._scroll_ancestor: Flow_Element
Flow_Element._needs_redraw: boolean
Flow_Element._scroll_changed: boolean
Flow_Element._clips_children: boolean
Flow_Element._clipping_visible: boolean
Flow_TextProps
Flow_TextProps.text: string
Flow_TextProps.align: "left" | "center" | "right"
Flow_TextProps.font: string
Flow_TextProps.scale: number | { x?: number; y?: number; z?: number }
Flow_TextProps.line_break: boolean
Flow_ButtonProps
Flow_ButtonProps.pressed_color: Flow_ColorValue
Flow_ButtonProps.on_click: (element: Flow_Element) => void
Flow_ButtonProps.image: string
Flow_ButtonProps.texture: string
Flow_ButtonProps.border: number | { left?: number; top?: number; right?: number; bottom?: number }
Flow_ButtonImageProps
Flow_ButtonImageProps.image: string
Flow_IconProps
Flow_IconProps.image: string
Flow_IconProps.texture: string
Flow_IconProps.scale: number | { x?: number; y?: number; z?: number }
Flow_IconProps.scale_mode: "stretch" | "fit"
Flow_IconProps.image_aspect: number
Flow_ScrollProps
Flow_ScrollProps._scrollbar: boolean
Flow_ScrollProps._bounce: boolean
Flow_ScrollProps._momentum: boolean
Flow_ScrollProps._virtual_height: number
Flow_ScrollProps._virtual_width: number
Flow_ScrollProps._scroll_y: number
Flow_ScrollProps._scroll_x: number
Flow_PopupProps
Flow_PopupProps.backdrop_color: Flow_ColorValue
Flow_PopupProps.on_backdrop_click: (element: Flow_Element) => void
Flow_BottomSheetProps
Flow_BottomSheetProps.backdrop_color: Flow_ColorValue
Flow_BottomSheetProps._open: boolean
Flow_BottomSheetProps._anim_y: number
Flow_BottomSheetProps._anim_velocity: number
Flow_BottomSheetProps._on_anim_update: (anim_y: number, velocity: number) => void
Flow_BottomSheetProps.on_backdrop_click: (element: Flow_Element) => void
Flow_BottomSheetApi
Flow_BottomSheetApi.dismiss: (result?: unknown) => boolean
Flow_BottomSheetApi.invalidate: () => boolean
Flow_BottomSheetSheetDef
Flow_BottomSheetSheetDef.view: (params: LuaTable, api: Flow_BottomSheetApi) => Flow_Element
Flow_BottomSheetSheetDef.screens: LuaTable<string, Flow_ScreenDef>
Flow_BottomSheetSheetDef.initial_screen: string
Flow_BottomSheetSheetDef.initial_params: LuaTable | ((params: LuaTable, api: Flow_BottomSheetApi) => LuaTable)
Flow_BottomSheetSheetDef.backdrop_color: Flow_ColorValue
Flow_BottomSheetSheetDef.dismiss_on_backdrop: boolean
Flow_BottomSheetSheetDef.on_dismiss: (params: LuaTable, result: unknown, api: Flow_BottomSheetApi) => void
Flow_BottomSheetHostConfig
Flow_BottomSheetHostConfig.id: string
Flow_BottomSheetHostConfig.sheet: Flow_BottomSheetSheetDef
Flow_BottomSheetHostConfig.open_message_id: Hash | string
Flow_BottomSheetHostConfig.close_message_id: Hash | string
Flow_BottomSheetHostConfig.background_focus_url: Url
Flow_BottomSheetHostConfig.render_order: number
Flow_BottomSheetHostConfig.debug: boolean
Flow_BottomSheetHostConfig.on_update: (self: LuaTable, dt: number, api: Flow_BottomSheetApi) => boolean | undefined
Flow_BottomSheetHostConfig.on_message: (self: LuaTable, message_id: Hash | string, message: LuaTable | undefined, sender: Url | undefined, api: Flow_BottomSheetApi) => boolean | undefined
Flow_LayoutRect
Flow_LayoutRect.x: number
Flow_LayoutRect.y: number
Flow_LayoutRect.w: number
Flow_LayoutRect.h: number
Flow_Logger
Flow_Logger.levels: LuaTable<string, number>
Flow_Logger.get_level: () => Flow_LogLevel
Flow_Logger.set_level: (level: Flow_LogLevel | number) => Flow_LogLevel
Flow_Logger.get_context_level: (context: string) => Flow_LogLevel | undefined
Flow_Logger.set_context_level: (context: string, level: Flow_LogLevel | number) => Flow_LogLevel
Flow_Logger.clear_context_level: (context: string) => boolean
Flow_Logger.none: (context?: string) => Flow_LogLevel
Flow_Logger.is_enabled: (level: Flow_LogLevel | number, context?: string) => boolean
Flow_Logger.set_sink: (fn?: (entry: LuaTable) => void) => boolean
Flow_Logger.debug: (context: string, ...args: unknown[]) => boolean
Flow_Logger.info: (context: string, ...args: unknown[]) => boolean
Flow_Logger.warn: (context: string, ...args: unknown[]) => boolean
Flow_Logger.error: (context: string, ...args: unknown[]) => boolean
Flow_Logger._reset_for_tests: () => boolean
Flow_TransitionMeta
Flow_TransitionMeta.action: string
Flow_TransitionMeta.type: "fade" | "slide_left" | "slide_right" | "none"
Flow_TransitionMeta.duration: number
Flow_TransitionMeta.from_id: string
Flow_TransitionMeta.to_id: string
Flow_ScreenDef
Flow_ScreenDef.view: (params: LuaTable, navigation: Flow_Navigation) => Flow_Element | undefined
Flow_ScreenDef.url: Url
msg.url() for lifecycle message delivery
Flow_ScreenDef.focus_url: Url
msg.url() of the script that owns input focus
Flow_ScreenDef.proxy_url: Url
msg.url() of a collection proxy to load