Skip to content

Commit

Permalink
Export ComponentAccessor and SignalComponentAccessor types.
Browse files Browse the repository at this point in the history
We only export types because consumers should not be able to call `ComponentAccessor.fromComponent` on an arbitrary component as this would leak internal details about that component such as its closed shadow root. Consumers should only use these objects via the provided `host` parameter in `defineComponent`.
  • Loading branch information
dgp1130 committed Sep 7, 2024
1 parent 78e4584 commit eacffdb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ export { ElementAccessor } from './element-accessor.js';
export { type Queryable } from './queryable.js';
export { QueryRoot } from './query-root.js';
export { hydrate, isHydrated } from './hydration.js';

// Only export the `ComponentAccessor` object types because consumers should not
// construct these objects directly as doing so would leak internal details
// about components such as a closed shadow root.
export { type ComponentAccessor } from './component-accessor.js';
export { type SignalComponentAccessor } from './signal-component-accessor.js';

0 comments on commit eacffdb

Please sign in to comment.