class UI::WidgetPlacement

Overview

Describes how a widget should be placed and refreshed on a specific platform surface.

This stays intentionally declarative. It records the widget family's intended placement and timeline behavior so host tooling can export the metadata into WidgetKit or another extension layer without pretending to render the widget in-app.

Defined in:

ui/widgets.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(surface : String, families : Array(String) | Nil = nil, timeline_intent : String = "snapshot", refresh_policy : String | Nil = nil, notes : String | Nil = nil) #

[View source]

Instance Method Detail

def add_family(family : String) : String #

[View source]
def export_widgetkit_scaffold(indent : String = " ") : String #

[View source]
def families : Array(String) #

[View source]
def families=(families : Array(String)) #

[View source]
def notes : String | Nil #

[View source]
def notes=(notes : String | Nil) #

[View source]
def refresh_policy : String | Nil #

[View source]
def refresh_policy=(refresh_policy : String | Nil) #

[View source]
def surface : String #

[View source]
def surface=(surface : String) #

[View source]
def timeline_intent : String #

[View source]
def timeline_intent=(timeline_intent : String) #

[View source]
def to_payload(json : JSON::Builder) : Nil #

[View source]
def widgetkit_families : String #

[View source]