Skip to content

Commit

Permalink
fix(orm): export types
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Jul 3, 2024
1 parent c7f89ce commit d09cebf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions orm/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { Store as DenoKvStore } from "./store/kv.ts"
export { is } from "./is/mod.ts"
export { Resource } from "./resource.ts"
export type { key, version } from "./store/store.ts"
export type { id, model, model_extended, shape } from "./resource.ts"
12 changes: 6 additions & 6 deletions orm/resource.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Imports
import type { key, Store } from "./store/store.ts"
import type { key, Store, version } from "./store/store.ts"
import type { Logger } from "@libs/logger"
import { ulid } from "@std/ulid"
import type { Arg, Arrayable, callback, DeepPartial, Nullable, record, rw } from "@libs/typing"
import { is } from "./is/mod.ts"

/** Resource identifier. */
type id = ReturnType<typeof ulid>
export type id = ReturnType<typeof ulid>

/** Resource shape. */
type shape = is.ZodRawShape
export type shape = is.ZodRawShape

/** Resource minimal model. */
const model = is.object({
Expand All @@ -19,11 +19,11 @@ const model = is.object({
})

/** Resource minimal model. */
type model = is.infer<typeof model>
export type model = is.infer<typeof model>

/** Resource extended model. */
// deno-lint-ignore ban-types
type model_extended<U extends {}> = is.infer<is.ZodObject<U>> & model
export type model_extended<U extends {}> = is.infer<is.ZodObject<U>> & model

/**
* Resource.
Expand Down Expand Up @@ -71,7 +71,7 @@ export class Resource<T extends model> {
}

/** KV version. */
version = null as Nullable<string>
version = null as Nullable<version>

/** KV keys. */
get keys(): key[] {
Expand Down

0 comments on commit d09cebf

Please sign in to comment.