Skip to content

Public Types

@nhtio/lucid-resourceful-vue-components/types

A type-only import surface so you don’t have to hunt through module barrels. Importing from this module guarantees you’re referencing the canonical public types, and it won’t pull any runtime code into your bundle.

Why this exists

When building apps at scale, types are often needed across views, stores, services, and tests. This module centralizes type exports for ergonomic, tree‑shakeable, type‑only imports.

How to import

  • Type-only (recommended):

    ts
    import type {
      ResourcefulHttpResponse,
      ResourcefulRecordEvents,
      ResourcefulIndexUrlAction,
      ValidationFieldBindings,
    } from '@nhtio/lucid-resourceful-vue-components/types'
  • With import type you avoid including any runtime artifacts.

Highlighted categories

  • IoC & infrastructure
    • IocService, IocServiceResolver, IocEventMap
    • ScopedDisplayInstance, ScopedDisplayOrientation
  • HTTP
    • ResourcefulHttpResponse, ResourcefulHttpProgress, ResourcefulHttpRequestMiddlewareFn, ResourcefulHttpResponseMiddlewareFn, ResourcefulHttpMiddlewareProxy
  • Resourceful Record
    • ResourceResourcefulRecordResponse, ResourcefulRecordViewMode, ResourcefulRecordEvents, ResourcefulRecordHooks
    • Hook handlers like ResourcefulRecordSuccessHookHandler, ResourcefulRecordFailureHookHandler, ResourcefulRecordProcessingHookHandler
  • Resourceful Index
    • ResourcefulIndexUrlAction, ResourcefulIndexFunctionAction, and callbacks like ResourcefulIndexActionCallback, ResourcefulIndexBulkActionCallback, ResourcefulIndexProgressCallback
  • Validation (forms)
    • ValidationFieldBindings, VeeValidateStateVInputProps, DefinedField, DataTypeOf
  • Field primitives
    • ResourcefulFieldType, RStringField, RNumberField, RBooleanField, etc. (value and props aliases)
  • Utilities & Vue types
    • MaybePromise, PropType, Slot, SlotsType, VNode, ComponentPublicInstance

Examples

Using HTTP types in a composable:

ts
import type { ResourcefulHttpResponse } from '@nhtio/lucid-resourceful-vue-components/types'

type User = { id: string; name: string }
function normalize(resp: ResourcefulHttpResponse<User[]>) {
  return resp.data.map((u) => u.name)
}

Typing record hooks:

ts
import type {
  ResourcefulRecordSuccessHookHandler,
  ResourceResourcefulRecordResponse,
} from '@nhtio/lucid-resourceful-vue-components/types'

const onSaved: ResourcefulRecordSuccessHookHandler = async (
  response: ResourceResourcefulRecordResponse,
  values
) => {
  // do something with response and values
}

Tips

  • Prefer import type { … } from this module for maximum clarity and to avoid accidental runtime imports.
  • If you need runtime helpers, use the targeted module (e.g., helpers, http, components, composables). Types remain available here for consistent, centralized access.
  • The set of types grows as features land; if something is missing, request an export here rather than importing from deep private paths.