Files
AFFiNE-Mirror/blocksuite/framework/store/src/index.ts
T

38 lines
1.2 KiB
TypeScript

// oxlint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../shim.d.ts" />
export * from './adapter/index.js';
export * from './reactive/index.js';
export * from './schema/index.js';
export * from './store/index.js';
export * from './transformer/index.js';
export { type IdGenerator, nanoid, uuidv4 } from './utils/id-generator.js';
export * as Utils from './utils/utils.js';
export * from './yjs/index.js';
const env =
typeof globalThis !== 'undefined'
? globalThis
: typeof window !== 'undefined'
? window
: // oxlint-disable-next-line
// @ts-ignore FIXME: typecheck error
typeof global !== 'undefined'
? // oxlint-disable-next-line
// @ts-ignore FIXME: typecheck error
global
: {};
const importIdentifier = '__ $BLOCKSUITE_STORE$ __';
// oxlint-disable-next-line
// @ts-ignore FIXME: typecheck error
if (env[importIdentifier] === true) {
// https://github.com/yjs/yjs/issues/438
console.error(
'@blocksuite/store was already imported. This breaks constructor checks and will lead to issues!'
);
}
// oxlint-disable-next-line
// @ts-ignore FIXME: typecheck error
env[importIdentifier] = true;