API Reference / @evolu/common / NanoId / NanoIdLib

Interface: NanoIdLib

Defined in: packages/common/src/NanoId.ts:20

Interface representing a NanoId library.

It's useful for testing by allowing ID generation to be mocked, ensuring consistent results.

See

https://github.com/ai/nanoid

Example

const foo = createFoo({
  ...createNanoIdLib(),
  ...createTime(),
});

Properties

PropertyModifierTypeDefined in
customAlphabetreadonly(alphabet, defaultSize?) => (size?) => stringpackages/common/src/NanoId.ts:23
nanoidreadonly(size?) => stringpackages/common/src/NanoId.ts:28
urlAlphabetreadonlystringpackages/common/src/NanoId.ts:21

Was this page helpful?