diff --git a/lib/@types/index.ts b/lib/@types/index.ts index ef8e5d1..d809b0b 100644 --- a/lib/@types/index.ts +++ b/lib/@types/index.ts @@ -1,8 +1,10 @@ import { App } from "vue"; +import type { SupabaseClientOptions } from "@supabase/supabase-js"; + export interface Params { supabaseUrl: string; supabaseKey: string; - options?: never; + options?: SupabaseClientOptions<'public'>; } export interface IVueSupabase { diff --git a/lib/main.d.ts b/lib/main.d.ts index ef415c5..a16116b 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -1,7 +1,13 @@ import type { IVueSupabase } from "./@types"; +import type { SupabaseClient } from "@supabase/supabase-js"; + declare module "@vue/runtime-core" { interface ComponentCustomProperties { $supabase: IVueSupabase; } } +export function useSupabase(): SupabaseClient; + +declare const supabasePlugin: IVueSupabase; +export default supabasePlugin; diff --git a/package.json b/package.json index 5517781..d0d9238 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "lint": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .", "lint:fix": "eslint --fix --ext .ts,.js,.vue --ignore-path .gitignore ." }, + "typings": "./dist/lib/main.d.ts", "peerDependencies": { "vue": "^3.0.5" },