From be0cd47f2158c94788f0144b75a0de21e65927ec Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 28 May 2025 10:19:26 -0700 Subject: [PATCH] docs: add import-graphTypes.js example file to demonstrate selective graphTypes imports Added a new example file `import-graphTypes.js` to showcase how to selectively import the `graphTypes` module, highlighting usage of `GraphNoun`, `GraphVerb`, `NounType`, and `VerbType`. --- examples/import-graphTypes.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/import-graphTypes.js diff --git a/examples/import-graphTypes.js b/examples/import-graphTypes.js new file mode 100644 index 00000000..beebac0f --- /dev/null +++ b/examples/import-graphTypes.js @@ -0,0 +1,24 @@ +// Example of importing only the graphTypes module +import { GraphNoun, GraphVerb, NounType, VerbType } from '@soulcraft/brainy/types/graphTypes'; + +// This demonstrates that we can import just the graphTypes +// without importing the rest of the library +console.log('Successfully imported graphTypes'); + +// Example usage of the imported types +const exampleNoun = { + id: '123', + createdBy: { + augmentation: 'test', + version: '1.0', + model: 'test-model', + modelVersion: '1.0' + }, + noun: NounType.Person, + createdAt: { seconds: Date.now() / 1000, nanoseconds: 0 }, + updatedAt: { seconds: Date.now() / 1000, nanoseconds: 0 } +}; + +console.log('Example noun type:', exampleNoun.noun); +console.log('Available noun types:', Object.values(NounType)); +console.log('Available verb types:', Object.values(VerbType));