@instantdb/react
Advanced tools
Comparing version 0.15.1 to 0.15.2
@@ -1,9 +0,9 @@ | ||
import { id, tx, lookup, i, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantObject, type InstantEntity, type InstantSchemaDatabase, type User, type AuthState, type Query, type Config, type InstaQLQueryParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantEntity, type DoNotUseInstaQLQueryResult, type DoNotUseUnknownSchema, type DoNotUseInstantSchema } from "@instantdb/core"; | ||
import { id, tx, lookup, i, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantObject, type InstantEntity, type InstantSchemaDatabase, type IInstantDatabase, type User, type AuthState, type Query, type Config, type InstaQLParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLResult, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema } from "@instantdb/core"; | ||
import { InstantReact } from "./InstantReact"; | ||
import { DoNotUseInstantReact } from "./DoNotUseInstantReact"; | ||
import InstantReactAbstractDatabase from "./InstantReactAbstractDatabase"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import { init, init_experimental, do_not_use_init_experimental } from "./init"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
import { init, init_experimental } from "./init"; | ||
import { Cursors } from "./Cursors"; | ||
export { id, tx, lookup, init, init_experimental, do_not_use_init_experimental, InstantReactWeb, DoNotUseInstantReactWeb, Cursors, i, InstantReact, DoNotUseInstantReact, type Config, type Query, type QueryResponse, type InstantObject, type User, type AuthState, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantEntity, type InstantSchemaDatabase, type InstaQLQueryParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantEntity, type DoNotUseInstaQLQueryResult, type DoNotUseUnknownSchema, type DoNotUseInstantSchema, }; | ||
export { id, tx, lookup, init, init_experimental, InstantReactWeb, InstantReactWebDatabase, Cursors, i, InstantReact, InstantReactAbstractDatabase, type Config, type Query, type QueryResponse, type InstantObject, type User, type AuthState, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantEntity, type InstantSchemaDatabase, type IInstantDatabase, type InstaQLParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLResult, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema, }; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DoNotUseInstantReact = exports.InstantReact = exports.i = exports.Cursors = exports.DoNotUseInstantReactWeb = exports.InstantReactWeb = exports.do_not_use_init_experimental = exports.init_experimental = exports.init = exports.lookup = exports.tx = exports.id = void 0; | ||
exports.InstantReactAbstractDatabase = exports.InstantReact = exports.i = exports.Cursors = exports.InstantReactWebDatabase = exports.InstantReactWeb = exports.init_experimental = exports.init = exports.lookup = exports.tx = exports.id = void 0; | ||
const core_1 = require("@instantdb/core"); | ||
@@ -11,14 +14,13 @@ Object.defineProperty(exports, "id", { enumerable: true, get: function () { return core_1.id; } }); | ||
Object.defineProperty(exports, "InstantReact", { enumerable: true, get: function () { return InstantReact_1.InstantReact; } }); | ||
const DoNotUseInstantReact_1 = require("./DoNotUseInstantReact"); | ||
Object.defineProperty(exports, "DoNotUseInstantReact", { enumerable: true, get: function () { return DoNotUseInstantReact_1.DoNotUseInstantReact; } }); | ||
const InstantReactAbstractDatabase_1 = __importDefault(require("./InstantReactAbstractDatabase")); | ||
exports.InstantReactAbstractDatabase = InstantReactAbstractDatabase_1.default; | ||
const InstantReactWeb_1 = require("./InstantReactWeb"); | ||
Object.defineProperty(exports, "InstantReactWeb", { enumerable: true, get: function () { return InstantReactWeb_1.InstantReactWeb; } }); | ||
const DoNotUseInstantReactWeb_1 = require("./DoNotUseInstantReactWeb"); | ||
Object.defineProperty(exports, "DoNotUseInstantReactWeb", { enumerable: true, get: function () { return DoNotUseInstantReactWeb_1.DoNotUseInstantReactWeb; } }); | ||
const InstantReactWebDatabase_1 = __importDefault(require("./InstantReactWebDatabase")); | ||
exports.InstantReactWebDatabase = InstantReactWebDatabase_1.default; | ||
const init_1 = require("./init"); | ||
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return init_1.init; } }); | ||
Object.defineProperty(exports, "init_experimental", { enumerable: true, get: function () { return init_1.init_experimental; } }); | ||
Object.defineProperty(exports, "do_not_use_init_experimental", { enumerable: true, get: function () { return init_1.do_not_use_init_experimental; } }); | ||
const Cursors_1 = require("./Cursors"); | ||
Object.defineProperty(exports, "Cursors", { enumerable: true, get: function () { return Cursors_1.Cursors; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
import type { Config, DoNotUseConfig, InstantGraph, DoNotUseInstantSchema, RoomSchemaShape, DoNotUseUnknownSchema } from "@instantdb/core"; | ||
import type { Config, InstantConfig, InstantSchemaDef, RoomSchemaShape, InstantUnknownSchema } from "@instantdb/core"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
/** | ||
@@ -25,7 +25,3 @@ * | ||
export declare function init<Schema extends {} = {}, RoomSchema extends RoomSchemaShape = {}>(config: Config): InstantReactWeb<Schema, RoomSchema, false>; | ||
export declare function init_experimental<Schema extends InstantGraph<any, any, any>, WithCardinalityInference extends boolean = true>(config: Config & { | ||
schema: Schema; | ||
cardinalityInference?: WithCardinalityInference; | ||
}): InstantReactWeb<Schema, Schema extends InstantGraph<any, any, infer RoomSchema extends RoomSchemaShape> ? RoomSchema : never, WithCardinalityInference>; | ||
export declare function do_not_use_init_experimental<Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema>(config: DoNotUseConfig<Schema>): DoNotUseInstantReactWeb<Schema>; | ||
export declare function init_experimental<Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema>(config: InstantConfig<Schema>): InstantReactWebDatabase<Schema>; | ||
//# sourceMappingURL=init.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.init = init; | ||
exports.init_experimental = init_experimental; | ||
exports.do_not_use_init_experimental = do_not_use_init_experimental; | ||
const InstantReactWeb_1 = require("./InstantReactWeb"); | ||
const DoNotUseInstantReactWeb_1 = require("./DoNotUseInstantReactWeb"); | ||
const InstantReactWebDatabase_1 = __importDefault(require("./InstantReactWebDatabase")); | ||
/** | ||
@@ -32,7 +34,4 @@ * | ||
function init_experimental(config) { | ||
return new InstantReactWeb_1.InstantReactWeb(config); | ||
return new InstantReactWebDatabase_1.default(config); | ||
} | ||
function do_not_use_init_experimental(config) { | ||
return new DoNotUseInstantReactWeb_1.DoNotUseInstantReactWeb(config); | ||
} | ||
//# sourceMappingURL=init.js.map |
@@ -1,2 +0,2 @@ | ||
import { InstantClient, Auth, Storage, type AuthState, type Config, type Query, type Exactly, type TransactionChunk, type DoNotUseLifecycleSubscriptionState, type PresenceOpts, type PresenceResponse, type RoomSchemaShape, type InstaQLQueryParams, type ConfigWithSchema, type IDatabase, type InstantGraph, type QueryResponse, type PageInfoResponse } from "@instantdb/core"; | ||
import { InstantClient, Auth, Storage, type AuthState, type Config, type Query, type Exactly, type TransactionChunk, type LifecycleSubscriptionState, type PresenceOpts, type PresenceResponse, type RoomSchemaShape, type InstaQLParams, type ConfigWithSchema, type IDatabase, type InstantGraph, type QueryResponse, type PageInfoResponse } from "@instantdb/core"; | ||
import { KeyboardEvent } from "react"; | ||
@@ -169,3 +169,3 @@ export type PresenceHandle<PresenceShape, Keys extends keyof PresenceShape> = PresenceResponse<PresenceShape, Keys> & { | ||
*/ | ||
useQuery: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: null | Q) => DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
useQuery: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: null | Q) => LifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
/** | ||
@@ -208,3 +208,3 @@ * Listen for the logged in state. This is useful | ||
*/ | ||
queryOnce: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<{ | ||
queryOnce: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<{ | ||
data: QueryResponse<Q, Schema, WithCardinalityInference>; | ||
@@ -211,0 +211,0 @@ pageInfo: PageInfoResponse<Q>; |
@@ -1,9 +0,9 @@ | ||
import { id, tx, lookup, i, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantObject, type InstantEntity, type InstantSchemaDatabase, type User, type AuthState, type Query, type Config, type InstaQLQueryParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantEntity, type DoNotUseInstaQLQueryResult, type DoNotUseUnknownSchema, type DoNotUseInstantSchema } from "@instantdb/core"; | ||
import { id, tx, lookup, i, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantObject, type InstantEntity, type InstantSchemaDatabase, type IInstantDatabase, type User, type AuthState, type Query, type Config, type InstaQLParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLResult, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema } from "@instantdb/core"; | ||
import { InstantReact } from "./InstantReact"; | ||
import { DoNotUseInstantReact } from "./DoNotUseInstantReact"; | ||
import InstantReactAbstractDatabase from "./InstantReactAbstractDatabase"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import { init, init_experimental, do_not_use_init_experimental } from "./init"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
import { init, init_experimental } from "./init"; | ||
import { Cursors } from "./Cursors"; | ||
export { id, tx, lookup, init, init_experimental, do_not_use_init_experimental, InstantReactWeb, DoNotUseInstantReactWeb, Cursors, i, InstantReact, DoNotUseInstantReact, type Config, type Query, type QueryResponse, type InstantObject, type User, type AuthState, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantEntity, type InstantSchemaDatabase, type InstaQLQueryParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantEntity, type DoNotUseInstaQLQueryResult, type DoNotUseUnknownSchema, type DoNotUseInstantSchema, }; | ||
export { id, tx, lookup, init, init_experimental, InstantReactWeb, InstantReactWebDatabase, Cursors, i, InstantReact, InstantReactAbstractDatabase, type Config, type Query, type QueryResponse, type InstantObject, type User, type AuthState, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantEntity, type InstantSchemaDatabase, type IInstantDatabase, type InstaQLParams, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstaQLEntity, type InstaQLResult, type InstantUnknownSchema, type InstantSchemaDef, type BackwardsCompatibleSchema, }; | ||
//# sourceMappingURL=index.d.ts.map |
import { id, tx, lookup, i, } from "@instantdb/core"; | ||
import { InstantReact } from "./InstantReact"; | ||
import { DoNotUseInstantReact } from "./DoNotUseInstantReact"; | ||
import InstantReactAbstractDatabase from "./InstantReactAbstractDatabase"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import { init, init_experimental, do_not_use_init_experimental } from "./init"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
import { init, init_experimental } from "./init"; | ||
import { Cursors } from "./Cursors"; | ||
export { id, tx, lookup, init, init_experimental, do_not_use_init_experimental, InstantReactWeb, DoNotUseInstantReactWeb, Cursors, i, | ||
export { id, tx, lookup, init, init_experimental, InstantReactWeb, InstantReactWebDatabase, Cursors, i, | ||
// internal | ||
InstantReact, DoNotUseInstantReact, }; | ||
InstantReact, InstantReactAbstractDatabase, }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
import type { Config, DoNotUseConfig, InstantGraph, DoNotUseInstantSchema, RoomSchemaShape, DoNotUseUnknownSchema } from "@instantdb/core"; | ||
import type { Config, InstantConfig, InstantSchemaDef, RoomSchemaShape, InstantUnknownSchema } from "@instantdb/core"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
/** | ||
@@ -25,7 +25,3 @@ * | ||
export declare function init<Schema extends {} = {}, RoomSchema extends RoomSchemaShape = {}>(config: Config): InstantReactWeb<Schema, RoomSchema, false>; | ||
export declare function init_experimental<Schema extends InstantGraph<any, any, any>, WithCardinalityInference extends boolean = true>(config: Config & { | ||
schema: Schema; | ||
cardinalityInference?: WithCardinalityInference; | ||
}): InstantReactWeb<Schema, Schema extends InstantGraph<any, any, infer RoomSchema extends RoomSchemaShape> ? RoomSchema : never, WithCardinalityInference>; | ||
export declare function do_not_use_init_experimental<Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema>(config: DoNotUseConfig<Schema>): DoNotUseInstantReactWeb<Schema>; | ||
export declare function init_experimental<Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema>(config: InstantConfig<Schema>): InstantReactWebDatabase<Schema>; | ||
//# sourceMappingURL=init.d.ts.map |
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
/** | ||
@@ -27,7 +27,4 @@ * | ||
export function init_experimental(config) { | ||
return new InstantReactWeb(config); | ||
return new InstantReactWebDatabase(config); | ||
} | ||
export function do_not_use_init_experimental(config) { | ||
return new DoNotUseInstantReactWeb(config); | ||
} | ||
//# sourceMappingURL=init.js.map |
@@ -1,2 +0,2 @@ | ||
import { InstantClient, Auth, Storage, type AuthState, type Config, type Query, type Exactly, type TransactionChunk, type DoNotUseLifecycleSubscriptionState, type PresenceOpts, type PresenceResponse, type RoomSchemaShape, type InstaQLQueryParams, type ConfigWithSchema, type IDatabase, type InstantGraph, type QueryResponse, type PageInfoResponse } from "@instantdb/core"; | ||
import { InstantClient, Auth, Storage, type AuthState, type Config, type Query, type Exactly, type TransactionChunk, type LifecycleSubscriptionState, type PresenceOpts, type PresenceResponse, type RoomSchemaShape, type InstaQLParams, type ConfigWithSchema, type IDatabase, type InstantGraph, type QueryResponse, type PageInfoResponse } from "@instantdb/core"; | ||
import { KeyboardEvent } from "react"; | ||
@@ -169,3 +169,3 @@ export type PresenceHandle<PresenceShape, Keys extends keyof PresenceShape> = PresenceResponse<PresenceShape, Keys> & { | ||
*/ | ||
useQuery: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: null | Q) => DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
useQuery: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: null | Q) => LifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
/** | ||
@@ -208,3 +208,3 @@ * Listen for the logged in state. This is useful | ||
*/ | ||
queryOnce: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<{ | ||
queryOnce: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<{ | ||
data: QueryResponse<Q, Schema, WithCardinalityInference>; | ||
@@ -211,0 +211,0 @@ pageInfo: PageInfoResponse<Q>; |
@@ -1,10 +0,10 @@ | ||
import { type Query, type Exactly, type InstantClient, type DoNotUseLifecycleSubscriptionState, type InstaQLQueryParams, type InstantGraph, DoNotUseInstantClient, DoNotUseDoNotUseLifecycleSubscriptionState, DoNotUseInstantSchema } from "@instantdb/core"; | ||
export declare function useQuery<Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>, Schema extends InstantGraph<any, any, any> | {}, WithCardinalityInference extends boolean>(_core: InstantClient<Schema, any, WithCardinalityInference>, _query: null | Q): { | ||
state: DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
import { type Query, type Exactly, type InstantClient, type LifecycleSubscriptionState, type InstaQLParams, type InstantGraph, InstantCoreDatabase, InstaQLLifecycleState, InstantSchemaDef } from "@instantdb/core"; | ||
export declare function useQuery<Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>, Schema extends InstantGraph<any, any, any> | {}, WithCardinalityInference extends boolean>(_core: InstantClient<Schema, any, WithCardinalityInference>, _query: null | Q): { | ||
state: LifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
query: any; | ||
}; | ||
export declare function doNotUseUseQuery<Q extends InstaQLQueryParams<Schema>, Schema extends DoNotUseInstantSchema<any, any, any>>(_core: DoNotUseInstantClient<Schema>, _query: null | Q): { | ||
state: DoNotUseDoNotUseLifecycleSubscriptionState<Q, Schema>; | ||
export declare function useQueryInternal<Q extends InstaQLParams<Schema>, Schema extends InstantSchemaDef<any, any, any>>(_core: InstantCoreDatabase<Schema>, _query: null | Q): { | ||
state: InstaQLLifecycleState<Schema, Q>; | ||
query: any; | ||
}; | ||
//# sourceMappingURL=useQuery.d.ts.map |
@@ -40,3 +40,3 @@ import { weakHash, coerceQuery, } from "@instantdb/core"; | ||
} | ||
export function doNotUseUseQuery(_core, _query) { | ||
export function useQueryInternal(_core, _query) { | ||
const query = _query ? coerceQuery(_query) : null; | ||
@@ -43,0 +43,0 @@ const queryHash = weakHash(query); |
export default version; | ||
declare const version: "v0.15.1"; | ||
declare const version: "v0.15.2"; | ||
//# sourceMappingURL=version.d.ts.map |
// Autogenerated by publish_packages.clj | ||
const version = "v0.15.1"; | ||
const version = "v0.15.2"; | ||
export default version; | ||
//# sourceMappingURL=version.js.map |
@@ -1,10 +0,10 @@ | ||
import { type Query, type Exactly, type InstantClient, type DoNotUseLifecycleSubscriptionState, type InstaQLQueryParams, type InstantGraph, DoNotUseInstantClient, DoNotUseDoNotUseLifecycleSubscriptionState, DoNotUseInstantSchema } from "@instantdb/core"; | ||
export declare function useQuery<Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>, Schema extends InstantGraph<any, any, any> | {}, WithCardinalityInference extends boolean>(_core: InstantClient<Schema, any, WithCardinalityInference>, _query: null | Q): { | ||
state: DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
import { type Query, type Exactly, type InstantClient, type LifecycleSubscriptionState, type InstaQLParams, type InstantGraph, InstantCoreDatabase, InstaQLLifecycleState, InstantSchemaDef } from "@instantdb/core"; | ||
export declare function useQuery<Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>, Schema extends InstantGraph<any, any, any> | {}, WithCardinalityInference extends boolean>(_core: InstantClient<Schema, any, WithCardinalityInference>, _query: null | Q): { | ||
state: LifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
query: any; | ||
}; | ||
export declare function doNotUseUseQuery<Q extends InstaQLQueryParams<Schema>, Schema extends DoNotUseInstantSchema<any, any, any>>(_core: DoNotUseInstantClient<Schema>, _query: null | Q): { | ||
state: DoNotUseDoNotUseLifecycleSubscriptionState<Q, Schema>; | ||
export declare function useQueryInternal<Q extends InstaQLParams<Schema>, Schema extends InstantSchemaDef<any, any, any>>(_core: InstantCoreDatabase<Schema>, _query: null | Q): { | ||
state: InstaQLLifecycleState<Schema, Q>; | ||
query: any; | ||
}; | ||
//# sourceMappingURL=useQuery.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useQuery = useQuery; | ||
exports.doNotUseUseQuery = doNotUseUseQuery; | ||
exports.useQueryInternal = useQueryInternal; | ||
const core_1 = require("@instantdb/core"); | ||
@@ -44,3 +44,3 @@ const react_1 = require("react"); | ||
} | ||
function doNotUseUseQuery(_core, _query) { | ||
function useQueryInternal(_core, _query) { | ||
const query = _query ? (0, core_1.coerceQuery)(_query) : null; | ||
@@ -47,0 +47,0 @@ const queryHash = (0, core_1.weakHash)(query); |
export default version; | ||
declare const version: "v0.15.1"; | ||
declare const version: "v0.15.2"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Autogenerated by publish_packages.clj | ||
const version = "v0.15.1"; | ||
const version = "v0.15.2"; | ||
exports.default = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@instantdb/react", | ||
"version": "v0.15.1", | ||
"version": "v0.15.2", | ||
"description": "Instant DB for React", | ||
@@ -35,4 +35,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@instantdb/core": "v0.15.1" | ||
"@instantdb/core": "v0.15.2" | ||
} | ||
} |
@@ -15,2 +15,3 @@ import { | ||
type InstantSchemaDatabase, | ||
type IInstantDatabase, | ||
type User, | ||
@@ -20,3 +21,3 @@ type AuthState, | ||
type Config, | ||
type InstaQLQueryParams, | ||
type InstaQLParams, | ||
@@ -36,13 +37,14 @@ // schema types | ||
type ValueTypes, | ||
type DoNotUseInstantEntity, | ||
type DoNotUseInstaQLQueryResult, | ||
type DoNotUseUnknownSchema, | ||
type DoNotUseInstantSchema, | ||
type InstaQLEntity, | ||
type InstaQLResult, | ||
type InstantUnknownSchema, | ||
type InstantSchemaDef, | ||
type BackwardsCompatibleSchema, | ||
} from "@instantdb/core"; | ||
import { InstantReact } from "./InstantReact"; | ||
import { DoNotUseInstantReact } from "./DoNotUseInstantReact"; | ||
import InstantReactAbstractDatabase from "./InstantReactAbstractDatabase"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import { init, init_experimental, do_not_use_init_experimental } from "./init"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
import { init, init_experimental } from "./init"; | ||
import { Cursors } from "./Cursors"; | ||
@@ -56,5 +58,4 @@ | ||
init_experimental, | ||
do_not_use_init_experimental, | ||
InstantReactWeb, | ||
DoNotUseInstantReactWeb, | ||
InstantReactWebDatabase, | ||
Cursors, | ||
@@ -65,3 +66,3 @@ i, | ||
InstantReact, | ||
DoNotUseInstantReact, | ||
InstantReactAbstractDatabase, | ||
@@ -80,3 +81,4 @@ // types | ||
type InstantSchemaDatabase, | ||
type InstaQLQueryParams, | ||
type IInstantDatabase, | ||
type InstaQLParams, | ||
@@ -96,6 +98,7 @@ // schema types | ||
type ValueTypes, | ||
type DoNotUseInstantEntity, | ||
type DoNotUseInstaQLQueryResult, | ||
type DoNotUseUnknownSchema, | ||
type DoNotUseInstantSchema, | ||
type InstaQLEntity, | ||
type InstaQLResult, | ||
type InstantUnknownSchema, | ||
type InstantSchemaDef, | ||
type BackwardsCompatibleSchema, | ||
}; |
import type { | ||
// types | ||
Config, | ||
DoNotUseConfig, | ||
InstantConfig, | ||
InstantGraph, | ||
DoNotUseInstantSchema, | ||
InstantSchemaDef, | ||
RoomSchemaShape, | ||
DoNotUseUnknownSchema, | ||
InstantUnknownSchema, | ||
} from "@instantdb/core"; | ||
import { InstantReactWeb } from "./InstantReactWeb"; | ||
import { DoNotUseInstantReactWeb } from "./DoNotUseInstantReactWeb"; | ||
import InstantReactWebDatabase from "./InstantReactWebDatabase"; | ||
@@ -41,23 +41,5 @@ /** | ||
export function init_experimental< | ||
Schema extends InstantGraph<any, any, any>, | ||
WithCardinalityInference extends boolean = true, | ||
>( | ||
config: Config & { | ||
schema: Schema; | ||
cardinalityInference?: WithCardinalityInference; | ||
}, | ||
) { | ||
return new InstantReactWeb< | ||
Schema, | ||
Schema extends InstantGraph<any, any, infer RoomSchema> | ||
? RoomSchema | ||
: never, | ||
WithCardinalityInference | ||
>(config); | ||
Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema, | ||
>(config: InstantConfig<Schema>) { | ||
return new InstantReactWebDatabase<Schema>(config); | ||
} | ||
export function do_not_use_init_experimental< | ||
Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema, | ||
>(config: DoNotUseConfig<Schema>) { | ||
return new DoNotUseInstantReactWeb<Schema>(config); | ||
} |
@@ -14,7 +14,7 @@ import { | ||
type TransactionChunk, | ||
type DoNotUseLifecycleSubscriptionState, | ||
type LifecycleSubscriptionState, | ||
type PresenceOpts, | ||
type PresenceResponse, | ||
type RoomSchemaShape, | ||
type InstaQLQueryParams, | ||
type InstaQLParams, | ||
type ConfigWithSchema, | ||
@@ -415,7 +415,7 @@ type IDatabase, | ||
Q extends Schema extends InstantGraph<any, any> | ||
? InstaQLQueryParams<Schema> | ||
? InstaQLParams<Schema> | ||
: Exactly<Query, Q>, | ||
>( | ||
query: null | Q, | ||
): DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference> => { | ||
): LifecycleSubscriptionState<Q, Schema, WithCardinalityInference> => { | ||
return useQuery(this._core, query).state; | ||
@@ -491,3 +491,3 @@ }; | ||
Q extends Schema extends InstantGraph<any, any> | ||
? InstaQLQueryParams<Schema> | ||
? InstaQLParams<Schema> | ||
: Exactly<Query, Q>, | ||
@@ -494,0 +494,0 @@ >( |
@@ -7,8 +7,8 @@ import { | ||
type InstantClient, | ||
type DoNotUseLifecycleSubscriptionState, | ||
type InstaQLQueryParams, | ||
type LifecycleSubscriptionState, | ||
type InstaQLParams, | ||
type InstantGraph, | ||
DoNotUseInstantClient, | ||
DoNotUseDoNotUseLifecycleSubscriptionState, | ||
DoNotUseInstantSchema, | ||
InstantCoreDatabase, | ||
InstaQLLifecycleState, | ||
InstantSchemaDef, | ||
} from "@instantdb/core"; | ||
@@ -36,3 +36,3 @@ import { useCallback, useRef, useSyncExternalStore } from "react"; | ||
Q extends Schema extends InstantGraph<any, any> | ||
? InstaQLQueryParams<Schema> | ||
? InstaQLParams<Schema> | ||
: Exactly<Query, Q>, | ||
@@ -45,3 +45,3 @@ Schema extends InstantGraph<any, any, any> | {}, | ||
): { | ||
state: DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
state: LifecycleSubscriptionState<Q, Schema, WithCardinalityInference>; | ||
query: any; | ||
@@ -58,3 +58,3 @@ } { | ||
const resultCacheRef = useRef< | ||
DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference> | ||
LifecycleSubscriptionState<Q, Schema, WithCardinalityInference> | ||
>(stateForResult(_core._reactor.getPreviousResult(query))); | ||
@@ -91,3 +91,3 @@ | ||
const state = useSyncExternalStore< | ||
DoNotUseLifecycleSubscriptionState<Q, Schema, WithCardinalityInference> | ||
LifecycleSubscriptionState<Q, Schema, WithCardinalityInference> | ||
>( | ||
@@ -101,10 +101,10 @@ subscribe, | ||
export function doNotUseUseQuery< | ||
Q extends InstaQLQueryParams<Schema>, | ||
Schema extends DoNotUseInstantSchema<any, any, any>, | ||
export function useQueryInternal< | ||
Q extends InstaQLParams<Schema>, | ||
Schema extends InstantSchemaDef<any, any, any>, | ||
>( | ||
_core: DoNotUseInstantClient<Schema>, | ||
_core: InstantCoreDatabase<Schema>, | ||
_query: null | Q, | ||
): { | ||
state: DoNotUseDoNotUseLifecycleSubscriptionState<Q, Schema>; | ||
state: InstaQLLifecycleState<Schema, Q>; | ||
query: any; | ||
@@ -121,3 +121,3 @@ } { | ||
const resultCacheRef = useRef< | ||
DoNotUseDoNotUseLifecycleSubscriptionState<Q, Schema> | ||
InstaQLLifecycleState<Schema, Q> | ||
>(stateForResult(_core._reactor.getPreviousResult(query))); | ||
@@ -154,3 +154,3 @@ | ||
const state = useSyncExternalStore< | ||
DoNotUseDoNotUseLifecycleSubscriptionState<Q, Schema> | ||
InstaQLLifecycleState<Schema, Q> | ||
>( | ||
@@ -157,0 +157,0 @@ subscribe, |
// Autogenerated by publish_packages.clj | ||
const version = "v0.15.1"; | ||
const version = "v0.15.2"; | ||
export default version; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
566333
9540
Updated@instantdb/core@v0.15.2