import { Controller, Sse, Headers } from '@nestjs/common';
import { interval, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
interface FeedPayload {
id: number;
import { useReducer } from 'react'
interface FormState {
values: Record<string, any>
errors: Record<string, string>
touched: Record<string, boolean>
export interface UploadHandle {
promise: Promise<{ status: number; body: string }>;
xhr: XMLHttpRequest;
}
export function uploadFile(
export interface Post {
id: string;
title: string;
updatedAt: string;
}
export type Validator = (value: string) => string | null;
export const required = (message = 'This field is required'): Validator => {
return (value) => (value.trim().length === 0 ? message : null);
};
import { useEffect, useState } from "react";
export function useDebouncedValue<T>(value: T, delay = 800): T {
const [debounced, setDebounced] = useState<T>(value);
useEffect(() => {
export type EventMap = Record<string, unknown[]>;
type Listener<Args extends unknown[]> = (...args: Args) => void;
export class TypedEmitter<Events extends EventMap> {
private listeners = new Map<keyof Events, Set<Listener<any>>>();
import { useCallback, useEffect, useRef } from 'react';
export function useRafThrottle(callback) {
const savedCallback = useRef(callback);
const frame = useRef(null);
const latestArgs = useRef([]);
import { useCallback, useEffect, useRef, useState } from 'react';
export type CopyStatus = 'idle' | 'copied' | 'error';
function fallbackCopy(text: string): boolean {
const textarea = document.createElement('textarea');
import { Response } from 'express';
type Client = { id: number; res: Response };
const clients = new Map<string, Set<Client>>();
let nextId = 1;
import { useCallback, useState } from 'react';
type CopiedValue = string | null;
type CopyFn = (text: string) => Promise<boolean>;
function legacyCopy(text: string): boolean {
import React, { useMemo } from 'react';
import { VirtualList } from './VirtualList';
interface LogEntry {
id: number;
level: 'info' | 'warn' | 'error';