Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > Połączenie > getShadowState
Metoda Connection.getShadowState()
Zwraca zserializowany obiekt bloku cienia połączenia.
Podpis:
getShadowState(returnCurrent?: boolean): blocks.State | null;
Parametry
Parametr |
Typ |
Opis |
returnCurrent |
wartość logiczna |
(Opcjonalnie) Jeśli ma wartość true (prawda), a do połączenia jest obecnie podłączony blok cienia, zserializuje stan tego bloku i je zwraca (aby wartości pól były prawidłowe). W przeciwnym razie zapisany stan jest po prostu zwracany. |
Zwroty:
blocks.State | wartość null
Zserializowana reprezentacja bloku lub wartość null.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["`Connection.getShadowState()` returns a serialized representation of the connection's shadow block, which can be used to recreate the block."],["The method accepts an optional boolean parameter `returnCurrent` that, if true, serializes the current state of the attached shadow block, including field values."],["If `returnCurrent` is false or there's no attached shadow block, the method returns the previously saved state of the shadow block."],["The returned value is of type `blocks.State` or null if there's no serialized shadow block data."]]],["The `getShadowState` method retrieves the serialized representation of a connection's shadow block. It accepts an optional `returnCurrent` boolean parameter. If `returnCurrent` is true and a shadow block is attached, the method returns the current state of that block, including field values. Otherwise, it returns the saved state. The method outputs either a serialized object representation of the block (`blocks.State`) or `null` if no shadow block is associated.\n"]]