PixelWeaver v0.5.0 /server.src.pixelweaver._gen.character_preview
On this page

Generated strictspec validator for the character-preview document: per-part variant and palette selections, randomizer weights, and oscillator functions.

#server.src.pixelweaver._gen.character_preview

#server.src.pixelweaver._gen.character_preview

#validate_bytes

python
def validate_bytes(input: bytes, syntax: str) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]

RAW-BYTES entry point: lossless parse of input in the given syntax ("json" | "toml" | "jsonl"), then validate. Returns the typed root value (None when any diagnostic fired) and the ordered diagnostics.

#validate_bytes_with_evidence

python
def validate_bytes_with_evidence(input: bytes, syntax: str, evidence: dict | None) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]

validate_bytes plus cross-document resolver evidence for the phase-2 constraint vocabulary.

#validate_value

python
def validate_value(v: Value) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]

TAGGED-VALUE entry point: validate an already-parsed tagged document value (from strictspec.load_value or a typed constructor). Raw untagged dicts are never accepted.

#CharacterPreviewState

Frozen typed binding of the "CharacterPreviewState" record. Immutable; use with_* for copy-on-write.

#with_version

python
def with_version(self, v: str) -> CharacterPreviewState

#with_parts

python
def with_parts(self, v: Value) -> CharacterPreviewState

#with_randomizer

python
def with_randomizer(self, v: RandomizerConfig) -> CharacterPreviewState

#with_oscillators

python
def with_oscillators(self, v: OscillatorConfig) -> CharacterPreviewState

#PartSelection

Frozen typed binding of the "PartSelection" record. Immutable; use with_* for copy-on-write.

#with_variantIndex

python
def with_variantIndex(self, v: int | None) -> PartSelection

#with_paletteClassId

python
def with_paletteClassId(self, v: str | None) -> PartSelection

#with_locked

python
def with_locked(self, v: bool) -> PartSelection

#RandomizerConfig

Frozen typed binding of the "RandomizerConfig" record. Immutable; use with_* for copy-on-write.

#with_seed

python
def with_seed(self, v: int) -> RandomizerConfig

#with_rollIndex

python
def with_rollIndex(self, v: int) -> RandomizerConfig

#with_variantWeights

python
def with_variantWeights(self, v: Value) -> RandomizerConfig

#with_paletteWeights

python
def with_paletteWeights(self, v: Value) -> RandomizerConfig

#OscillatorConfig

Frozen typed binding of the "OscillatorConfig" record. Immutable; use with_* for copy-on-write.

#with_functions

python
def with_functions(self, v: list[Value]) -> OscillatorConfig

#with_assignments

python
def with_assignments(self, v: list[OscAssignment]) -> OscillatorConfig

#SineFunction

Frozen typed binding of the "SineFunction" record. Immutable; use with_* for copy-on-write.

#with_id

python
def with_id(self, v: str) -> SineFunction

#with_name

python
def with_name(self, v: str) -> SineFunction

#with_type

python
def with_type(self, v: str) -> SineFunction

#with_axis

python
def with_axis(self, v: str) -> SineFunction

#with_amplitudePx

python
def with_amplitudePx(self, v: int) -> SineFunction

#with_periodMs

python
def with_periodMs(self, v: float) -> SineFunction

#with_phaseMs

python
def with_phaseMs(self, v: float) -> SineFunction

#BlinkFunction

Frozen typed binding of the "BlinkFunction" record. Immutable; use with_* for copy-on-write.

#with_id

python
def with_id(self, v: str) -> BlinkFunction

#with_name

python
def with_name(self, v: str) -> BlinkFunction

#with_type

python
def with_type(self, v: str) -> BlinkFunction

#with_periodMs

python
def with_periodMs(self, v: float) -> BlinkFunction

#with_onMs

python
def with_onMs(self, v: float) -> BlinkFunction

#with_phaseMs

python
def with_phaseMs(self, v: float) -> BlinkFunction

#OscAssignment

Frozen typed binding of the "OscAssignment" record. Immutable; use with_* for copy-on-write.

#with_functionId

python
def with_functionId(self, v: str) -> OscAssignment

#with_partKey

python
def with_partKey(self, v: str) -> OscAssignment

#with_layerId

python
def with_layerId(self, v: str | None) -> OscAssignment

#with_blinkMode

python
def with_blinkMode(self, v: str) -> OscAssignment
Search