UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

20 lines (19 loc) 1.54 kB
import { CoreEntity } from '../../CoreEntity'; import { AttribValue, NumericAttribValue } from '../../../../types/GlobalTypes'; import { Color, Vector2, Vector3, Vector4 } from 'three'; import { CoreObjectType, ObjectContent } from '../../ObjectContent'; import { AttribSize } from '../../Constant'; type GetRelatedCallback<T extends CoreEntity, E extends CoreEntity> = (entity: T) => E[]; type GetRelatedIdCallback<E extends CoreEntity> = (id: number, target: number[]) => void; export declare function uniqRelatedEntities<T extends CoreEntity, E extends CoreEntity>(entities: T[], callback: GetRelatedCallback<T, E>, target: E[]): void; export declare function uniqRelatedEntityIds<E extends CoreEntity>(entityIds: number[], callback: GetRelatedIdCallback<E>, target: number[]): void; export declare function attribValueNonPrimitive(src: AttribValue): boolean; export declare function copyAttribValue(src: AttribValue, target: AttribValue): void; export declare function cloneAttribValue(src: AttribValue): Vector2 | Vector3 | Vector4 | Color | undefined; export interface AttributeNumericValuesOptions { attributeAdded: boolean; values: number[]; } type EntitiesCountFunction<T extends CoreObjectType> = (object: ObjectContent<T>) => number; export declare function attributeNumericValues<T extends CoreObjectType>(object: ObjectContent<T>, entitiesCountFunction: EntitiesCountFunction<T>, attribSize: AttribSize | undefined, defaultValue: NumericAttribValue | undefined, target: AttributeNumericValuesOptions): void; export {};