Skip to content

Commit

Permalink
- Fix export function issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaro-canepa committed Sep 8, 2024
1 parent 5817d6a commit fc34fd2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@planetadeleste/pinia-orm-core",
"version": "1.0.6",
"version": "1.0.7",
"description": "",
"repository": {
"type": "git",
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Element, ModelOptions } from "pinia-orm";
import { Model as BaseModel } from "pinia-orm";
import type { Request } from "@pinia-orm/axios";

interface Model<T extends Element = Element> extends BaseModel {
$getOriginal: () => T;
Expand All @@ -25,6 +26,10 @@ declare class Model extends BaseModel {
$baseUrl(): string;
}

declare function useOrmModel<M extends Model, R extends Request = Request>(
obModel: Constructor<M>,
): fnUseOrmModel<M, R>;

export type {
ApiLinksResponse,
ApiMetaResponse,
Expand All @@ -37,4 +42,4 @@ export type {
Constructor,
fnUseOrmModel,
} from "./types";
export { Model };
export { Model, useOrmModel };
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as Model } from "./Model";
export { default as useOrmModel } from "./useOrm";
export { useOrmModel } from "./useOrm";
2 changes: 1 addition & 1 deletion packages/core/src/useOrm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from "./types";
import type { Model } from "./index";

export default function <M extends Model, R extends Request = Request>(
export function useOrmModel<M extends Model, R extends Request = Request>(
obModel: Constructor<M>,
): fnUseOrmModel<M, R> {
const repo = useRepo<M>(obModel);
Expand Down

0 comments on commit fc34fd2

Please sign in to comment.