All files / router/src enum.ts

100% Statements 34/34
100% Branches 0/0
100% Functions 0/0
100% Lines 34/34

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58                            1x   1x   1x   1x   1x 1x   1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x   1x 1x 1x 1x   1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Route type enumeration.
 *
 * Defines the different types of routes that can be created in the router.
 *
 * @example
 * ```ts
 * import { ROUTE_TYPE } from '@anchorlib/router';
 *
 * if (route.type === ROUTE_TYPE.DYNAMIC) {
 *   console.log('This is a dynamic route with parameters');
 * }
 * ```
 */
export const ROUTE_TYPE = {
  /** Index route - matches the root path `/` */
  INDEX: 'index',
  /** Static route - matches a fixed path segment */
  STATIC: 'static',
  /** Dynamic route - matches a parameterized path like `:id` */
  DYNAMIC: 'dynamic',
  /** Wildcard route - matches any remaining path segments using `*` */
  WILDCARD: 'wildcard',
} as const;
 
export const PRELOAD_MODE = {
  HOVER: 'hover',
  MANUAL: 'manual',
  ALWAYS: 'always',
} as const;
 
export const ROUTE_STATUS = {
  IDLE: 'idle',
  PENDING: 'pending',
  SUCCESS: 'success',
  ERROR: 'error',
} as const;
 
export const RENDER_MODE = {
  DEFERRED: 'deferred',
  IMMEDIATE: 'immediate',
} as const;
 
export const RETRY_MODE = {
  LINEAR: 'linear',
  EXPONENTIAL: 'exponential',
} as const;
 
export const MAX_AGE = {
  SECOND: 1000,
  MINUTE: 1000 * 60,
  HOUR: 1000 * 60 * 60,
  DAY: 1000 * 60 * 60 * 24,
  WEEK: 1000 * 60 * 60 * 24 * 7,
  MONTH: 1000 * 60 * 60 * 24 * 30,
  YEAR: 1000 * 60 * 60 * 24 * 365,
};