From 50187910b4b6fef70ca1f41bd097894f266bab78 Mon Sep 17 00:00:00 2001 From: fede Date: Fri, 14 Nov 2025 15:37:37 -0300 Subject: [PATCH] creada store de usuario --- src/lib/stores/usuario.ts | 11 +++++++++++ src/types.d.ts | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/lib/stores/usuario.ts diff --git a/src/lib/stores/usuario.ts b/src/lib/stores/usuario.ts new file mode 100644 index 0000000..a337b11 --- /dev/null +++ b/src/lib/stores/usuario.ts @@ -0,0 +1,11 @@ +import { writable } from 'svelte/store'; +import type { User } from '../../types'; + +export const currentUser = writable(null); + +export const userStore = { + subscribe: currentUser.subscribe, + set: currentUser.set, + update: currentUser.update, + reset: () => currentUser.set(null) +}; diff --git a/src/types.d.ts b/src/types.d.ts index f157535..4cb424b 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -12,3 +12,16 @@ export interface Post { visibility: string; hashtags?: string[]; } +export interface User { + _id: string; + displayName: string; + username: string; + email: string; + passwordHash: string; + bio?: string; + profileImageUrl?: string; + createdAt: Date; + followersCount: number; + followingCount: number; + refreshTokens: RefreshToken[]; +}