From 2f25703e1425b054d1510783931e765f90494623 Mon Sep 17 00:00:00 2001 From: Trezy Date: Sat, 15 Jun 2024 01:38:08 -0500 Subject: [PATCH] fix: disallow children from being passed to constructors --- src/typedefs/HostConfig.js | 4 ++-- src/typedefs/PixiElements.js | 15 --------------- src/typedefs/PixiElementsImpl.js | 3 +-- 3 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 src/typedefs/PixiElements.js diff --git a/src/typedefs/HostConfig.js b/src/typedefs/HostConfig.js index 56bd40e0..407f321a 100644 --- a/src/typedefs/HostConfig.js +++ b/src/typedefs/HostConfig.js @@ -1,9 +1,9 @@ /** @typedef {import('./Instance.js').Instance} Instance */ -/** @typedef {import('../typedefs/PixiElements.js').PixiElements} PixiElements */ +/** @typedef {import('../typedefs/PixiElementsImpl.js').PixiElementsImpl} PixiElementsImpl */ /** * @typedef {object} HostConfig - * @property {keyof PixiElements} type + * @property {keyof PixiElementsImpl} type * @property {Record} props * @property {Instance} container * @property {Instance} instance diff --git a/src/typedefs/PixiElements.js b/src/typedefs/PixiElements.js deleted file mode 100644 index 1adc415b..00000000 --- a/src/typedefs/PixiElements.js +++ /dev/null @@ -1,15 +0,0 @@ -/** @typedef {typeof import('pixi.js')} PixiType */ -/** @typedef {import('react')} React */ - -/** - * @typedef {{ - * [K in import('./AutoFilteredKeys.js').AutoFilteredKeys]: [ - * Uncapitalize, - * React.PropsWithChildren< - * import('./ConstructorParams.js').ConstructorParams - * & { init?: readonly any[] } - * > & React.PropsWithRef<{ ref?: React.MutableRefObject> }> - * ]; - * }} PixiElements - */ -export const PixiElements = {}; diff --git a/src/typedefs/PixiElementsImpl.js b/src/typedefs/PixiElementsImpl.js index 3351d0a8..5ef153e3 100644 --- a/src/typedefs/PixiElementsImpl.js +++ b/src/typedefs/PixiElementsImpl.js @@ -3,7 +3,6 @@ import { NameOverrides } from '../constants/NameOverrides.js'; /** @typedef {typeof import('pixi.js')} PixiType */ /** @typedef {import('./AutoFilteredKeys.js').AutoFilteredKeys} AutoFilteredKeys */ -/** @typedef {import('./PixiElements.js').PixiElements} PixiElements */ /** @typedef {import('./PixiOptions.js').PixiOptions} PixiOptions */ /** @@ -15,7 +14,7 @@ import { NameOverrides } from '../constants/NameOverrides.js'; * @typedef {{ * [K in AutoFilteredKeys as K extends keyof typeof NameOverrides ? typeof NameOverrides[K] : Uncapitalize]: * import('react').PropsWithChildren< - * PixiOptionsType> + * Omit>, 'children'> * & { init?: import('./ConstructorParams.js').ConstructorParams } * > & import('react').PropsWithRef<{ ref?: import('react').MutableRefObject> }> * }} PixiElementsImpl