brainy/examples/import-graphTypes.js
David Snelling be0cd47f21 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`.
2025-05-28 10:19:26 -07:00

24 lines
820 B
JavaScript

// 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));