diff --git a/src/hooks/useStorageState/ko/useStorageState.md b/src/hooks/useStorageState/ko/useStorageState.md index d7a80ebc..27e23c22 100644 --- a/src/hooks/useStorageState/ko/useStorageState.md +++ b/src/hooks/useStorageState/ko/useStorageState.md @@ -5,7 +5,7 @@ ## 인터페이스 ```ts -function useStorageState( +function useStorageState( key: string, options: Object ): readonly [ @@ -45,13 +45,13 @@ function useStorageState( }, { name: 'options.serializer', - type: 'Function', + type: '(value: Serializable) => string', required: false, description: '상태 값을 문자열로 직렬화하는 함수예요.', }, { name: 'options.deserializer', - type: 'Function', + type: '(value: string) => Serializable', required: false, description: '상태 값을 문자열에서 역직렬화하는 함수예요.', }, diff --git a/src/hooks/useStorageState/useStorageState.md b/src/hooks/useStorageState/useStorageState.md index 55fc5064..9627b8f5 100644 --- a/src/hooks/useStorageState/useStorageState.md +++ b/src/hooks/useStorageState/useStorageState.md @@ -45,13 +45,13 @@ function useStorageState( }, { name: 'options.serializer', - type: 'Function', + type: '(value: Serializable) => string', required: false, description: 'A function to serialize the state value to a string.', }, { name: 'options.deserializer', - type: 'Function', + type: '(value: string) => Serializable', required: false, description: 'A function to deserialize the state value from a string.', }, diff --git a/src/hooks/useStorageState/useStorageState.ts b/src/hooks/useStorageState/useStorageState.ts index 5d87d2e3..a7c23ef7 100644 --- a/src/hooks/useStorageState/useStorageState.ts +++ b/src/hooks/useStorageState/useStorageState.ts @@ -70,8 +70,8 @@ const ensureSerializable = (value: T): SerializableGua * @param {Object} [options] - Configuration options for storage behavior. * @param {Storage} [options.storage=localStorage] - The storage type (`localStorage` or `sessionStorage`). Defaults to `localStorage`. * @param {T} [options.defaultValue] - The initial value if no existing value is found. - * @param {Function} [options.serializer] - A function to serialize the state value to a string. - * @param {Function} [options.deserializer] - A function to deserialize the state value from a string. + * @param {(value: Serializable) => string} [options.serializer] - A function to serialize the state value to a string. + * @param {(value: string) => Serializable} [options.deserializer] - A function to deserialize the state value from a string. * * @returns {readonly [state: Serializable | undefined, setState: (value: SetStateAction | undefined>) => void, refreshState: () => void]} A tuple: * - state `Serializable | undefined` - The current state value retrieved from storage;