FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/types / FaasParams

Type Alias: FaasParams<T>

FaasParams<T> = T extends FaasActionPaths ? FaasActions[T]["Params"] : T extends string ? Record<string, unknown> : never

Infer the params type for a given action path.

When T matches a declared action path, resolves to FaasActions[T]['Params']. Falls back to Record<string, unknown> for explicit unrecognized string paths. Returns never when T is not a string; the bare FaasParams default uses unknown, so it also resolves to never.

Type Parameters

T

T = unknown

Candidate action path or params type.

Returns

FaasActions[T]['Params'] when T is a registered action path, Record<string, unknown> for any unregistered string, or never when T is not a string.

Example

// Registered action — resolves to the declared Params type
type LoginParams = FaasParams<'user/login'>
// → { email: string; password: string }

// Unregistered string — falls back to a generic record
type UnknownParams = FaasParams<'some/action'>
// → Record<string, unknown>

// Non-string — resolves to never
type Invalid = FaasParams<42>
// → never

See

  • FaasActionPaths
  • FaasData