import * as types from "./basic_types"
import * as common from "./common"

export type SkinnedAnimation = {
    animationID?: string;
    skeletonGroupID?: string;
    animationSpeed?: number;
}

export type GravityAttractor = {
    acceleration?: number;
    radius?: number;
}

export type Rendering = {
    meshID?: string;
    materialID?: string;
    materialVersion?: types.ResVersion;
    castShadow?: boolean;
}

export type Transform = {
    transform?: types.Transform;
}

export type VfxTransform = {
    initialTransform?: types.Transform;
    durationInSeconds?: number;
    easingType?: common.EasingType;
}

export type Spawnpoint = {
    value?: number;
}

export type Collider = {
    collider?: types.Collider;
    friction?: number;
    restitution?: number;
    isGround?: boolean;
    collisionGroup?: types.PhysicsFilter;
    collisionMask?: types.PhysicsFilter;
    canGenerateEvent?: boolean;
    alwaysUseConvexColliders?: boolean;
}

export type Pointlight = {
    color?: types.float3;
    strength?: number;
    radius?: number;
    offset?: types.float3;
}

export type Button = {
    value?: number;
}

export type TriggerBox = {
    size?: types.float3;
    offset?: types.float3;
}

export type Checkpoint = {
    dummy?: boolean;
}

export type Collectible = {
    type?: common.CollectibleType;
    pointValue?: number;
    grabbingOffset?: types.float3;
    grabbingRadius?: number;
    collectFxId?: string;
    resetFxId?: string;
}

export type RemoteTexture = {
    textureUrl?: types.str320;
}

export type VideoTexture = {
    videoUrl?: types.str320;
    startPlayingAtTimeSecs?: number;
    emissiveStrength?: number;
    soundMinDistance?: number;
    soundFadeDistance?: number;
}

export type DealDamageOnTouch = {
    amount?: number;
    knockbackStrengthInProcent?: number;
    takeDamageFxId?: string;
    skipDamageFxId?: string;
}

export type Goal = {
    dummy?: boolean;
}

export type CountdownTimer = {
    timeInSecs?: number;
}

export type RemoveEntityAfterDelay = {
    removalDelayInSeconds?: number;
}

export type Billboard = {
    dummy?: number;
}

export type Audio = {
    id?: string;
    volume?: number;
    rollOffFactor?: number;
    minAttenuationDist?: number;
    maxAttenuationDist?: number;
    startPlayingDist?: number;
    looping?: boolean;
    attenuationModel?: common.AudioAttenuationModel;
}

export type Spotlight = {
    dir?: types.float3;
    radius?: number;
    color?: types.float3;
    strength?: number;
    openingAngleDegs?: number;
    offset?: types.float3;
}

export type Keyframe = {
    targetObjectId?: number;
    timeline?: number;
    timestamp?: types.Time;
    easing?: common.EasingType;
}

export type KeyframeAxisAngleRotation = {
    axis?: types.float3;
    angle?: number;
}

export type KeyframeTransformMask = {
    positionX?: boolean;
    positionY?: boolean;
    positionZ?: boolean;
    rotation?: boolean;
    scaleX?: boolean;
    scaleY?: boolean;
    scaleZ?: boolean;
}

export type KeyframeLight = {
    color?: types.float3;
    strength?: number;
    radius?: number;
}

export type KeyframeParticleSystemEmitter = {
    spawnRate?: number;
    velocity?: types.float3;
    randomVelocity?: types.float3;
    inheritVelocity?: number;
    size?: types.float3;
    shape?: common.ParticleEmitterShape;
    emitterMesh?: string;
}

export type KeyframeAnimated = {
    startTimestamp?: types.Time;
    speedMultiplier?: number;
    loopBehaviour?: common.LoopBehaviour;
    initialState?: common.KeyframeAnimatedState;
    beforeStartBehavior?: common.KeyframeAnimatedBeforeStartBehavior;
    afterEndBehavior?: common.KeyframeAnimatedAfterEndBehavior;
    roundToNearestBeat?: boolean;
    syncToMusic?: boolean;
}

export type SnapTo = {
    parentObjectId?: number;
    snapPosition?: boolean;
    snapRotation?: boolean;
    snapScale?: boolean;
    transformLS?: types.Transform;
}

export type ParticleSystemEmitter = {
    particleCountMax?: number;
    shape?: common.ParticleEmitterShape;
    traceGround?: boolean;
    continuous?: boolean;
    spawnRate?: number;
    velocity?: types.float3;
    randomVelocity?: types.float3;
    size?: types.float3;
    offset?: types.float3;
    inheritVelocity?: number;
    emitterLifeTime?: number;
    emitterMesh?: string;
}

export type ParticleSystemParticle = {
    lifetime?: number;
    lifeRandom?: number;
    sizeStart?: number;
    sizeEnd?: number;
    sizeRandom?: number;
    randomRotation?: number;
    rotationSpeed?: number;
    randomRotationSpeed?: number;
    rotationWobbleAmount?: number;
    rotationWobbleFrequency?: number;
    billboardAlign?: common.ParticleBillboardAlignMode;
}

export type ParticleSystemParticleMaterial = {
    particleTexture?: string;
    colorStart?: types.float4;
    colorEnd?: types.float4;
    linearColorRandom?: number;
    gradientTexture?: string;
    gradientColorRandom?: number;
    blendMode?: common.ParticleBlendMode;
    depthSort?: boolean;
}

export type ParticleSystemVelocityModifiers = {
    forceGravity?: number;
    forceAirRes?: number;
    wobbleVelocity?: types.float3;
    wobbleFrequency?: types.float3;
    collisionMode?: common.ParticleCollisionMode;
    collisionBounceFactor?: number;
}

export type Name = {
    value?: types.str80;
}

export type PlayMusicOnSignal = {
    id?: string;
    volume?: number;
    shouldLoop?: boolean;
    minAttenuationDist?: number;
    maxAttenuationDist?: number;
    rollOffFactor?: number;
    attenuationModel?: common.AudioAttenuationModel;
    soundType?: common.SoundType;
    solo?: boolean;
}

export type LookAtSensor = {
    maxDistance?: number;
    minDistance?: number;
}

export type InfoPanel = {
    header?: types.str80;
    preBody?: types.str80;
    body?: types.str80;
    url?: types.str320;
    imageID?: string;
    isOpenInNewTabEnabled?: boolean;
    isOpenInOverlayEnabled?: boolean;
    isOpenInOverlayOnTouch?: boolean;
    minShowDistance?: number;
    maxShowDistance?: number;
    openUrlInNewTab?: boolean;
    showOpenBinding?: boolean;
}

export type PlayerRaycaster = {
    dummy?: boolean;
}

export type WarpPortal = {
    targetURL?: types.str320;
    targetLevelID?: number;
    radius?: number;
}

export type VisibleInPlayOnly = {
    visibleInPlayOnlyType?: common.VisibleInPlayOnlyType;
}

export type SignalListener = {
    triggerObjectReference?: common.ObjectReference;
    playerConnectable?: boolean;
    defaultSignal?: types.Signal;
    interactableWhenNotConnected?: boolean;
}

export type SignalSource = {
    playerConnectable?: boolean;
}

export type ExternalGlbDependency = {
    url?: types.str128;
    parameters?: types.str128;
    skeleton?: common.AvatarSkeleton;
    skipCollider?: boolean;
}

export type LightOnSignal = {
    maxStrength?: number;
}

export type SignalSwitch = {
    dummy?: boolean;
}

export type ColliderIsSensor = {
    dummy?: boolean;
}

export type AccelerationVolume = {
    dir?: types.float3;
    acceleration?: number;
    maxSpeed?: number;
    stickToCenterEnabled?: boolean;
    stickToCenterSpeedFactor?: number;
    stickToCenterDamping?: number;
    stickToCenterPerpDamping?: number;
}

export type VfxInVolume = {
    prefabId?: string;
}

export type LogicGate = {
    type?: common.LogicGateType;
    input1?: common.ObjectReference;
    input2?: common.ObjectReference;
}

export type PlayerProximitySensor = {
    minDistance?: number;
    maxDistance?: number;
}

export type RemoveGroupOnCollide = {
    dummy?: boolean;
}

export type AbilityCollidable = {
    abilityIds?: string[];
}

export type PrefabSpawner = {
    prefabID?: string;
    startIdle?: boolean;
    spawnRule?: common.PrefabSpawnerSpawnRule;
    intervalRule?: common.PrefabSpawnerIntervalRule;
    spawnInterval?: number;
    spawnIntervalMin?: number;
    spawnIntervalMax?: number;
    spawnAmountRule?: common.PrefabSpawnAmountRule;
    spawnAmount?: number;
    spawnAmountMin?: number;
    spawnAmountMax?: number;
    spawnedAmountLimit?: number;
    resetOnPlayerRespawn?: boolean;
    resetOnPlayerIntentChanged?: boolean;
    firstSpawnShouldBeInstant?: boolean;
}

export type Interactible = {
    minDistance?: number;
    maxDistance?: number;
}

export type ParticleSystemWrapBox = {
    size?: types.float3;
    offset?: types.float3;
}

export type RenderOverlay = {
    layers?: common.RenderOverlayLayer[];
}

export type ColliderIsDisabled = {
    dummy?: boolean;
}

export type InvisibleOnSignal = {
    dummy?: boolean;
}

export type MaterialOnSignal = {
    signalOnMaterial?: string;
    signalOffMaterial?: string;
}

export type SpawnPrefabOnSignal = {
    prefabID?: string;
}

export type SignalRelay = {
    dummy?: boolean;
}

export type AdBillboard = {
    provider?: common.AdProvider;
    adIndex?: number;
    distanceThreshold?: number;
}

export type PlayAnimationOnSignal = {
    dummy?: boolean;
}

export type Property = { 
    skinnedAnimation?: SkinnedAnimation;
    gravityAttractor?: GravityAttractor;
    rendering?: Rendering;
    transform?: Transform;
    vfxTransform?: VfxTransform;
    spawnpoint?: Spawnpoint;
    collider?: Collider;
    pointlight?: Pointlight;
    button?: Button;
    triggerBox?: TriggerBox;
    checkpoint?: Checkpoint;
    collectible?: Collectible;
    remoteTexture?: RemoteTexture;
    videoTexture?: VideoTexture;
    dealDamageOnTouch?: DealDamageOnTouch;
    goal?: Goal;
    countdownTimer?: CountdownTimer;
    removeEntityAfterDelay?: RemoveEntityAfterDelay;
    billboard?: Billboard;
    audio?: Audio;
    spotlight?: Spotlight;
    keyframe?: Keyframe;
    keyframeAxisAngleRotation?: KeyframeAxisAngleRotation;
    keyframeTransformMask?: KeyframeTransformMask;
    keyframeLight?: KeyframeLight;
    keyframeParticleSystemEmitter?: KeyframeParticleSystemEmitter;
    keyframeAnimated?: KeyframeAnimated;
    snapTo?: SnapTo;
    particleSystemEmitter?: ParticleSystemEmitter;
    particleSystemParticle?: ParticleSystemParticle;
    particleSystemParticleMaterial?: ParticleSystemParticleMaterial;
    particleSystemVelocityModifiers?: ParticleSystemVelocityModifiers;
    name?: Name;
    playMusicOnSignal?: PlayMusicOnSignal;
    lookAtSensor?: LookAtSensor;
    infoPanel?: InfoPanel;
    playerRaycaster?: PlayerRaycaster;
    warpPortal?: WarpPortal;
    visibleInPlayOnly?: VisibleInPlayOnly;
    signalListener?: SignalListener;
    signalSource?: SignalSource;
    externalGlbDependency?: ExternalGlbDependency;
    lightOnSignal?: LightOnSignal;
    signalSwitch?: SignalSwitch;
    colliderIsSensor?: ColliderIsSensor;
    accelerationVolume?: AccelerationVolume;
    vfxInVolume?: VfxInVolume;
    logicGate?: LogicGate;
    playerProximitySensor?: PlayerProximitySensor;
    removeGroupOnCollide?: RemoveGroupOnCollide;
    abilityCollidable?: AbilityCollidable;
    prefabSpawner?: PrefabSpawner;
    interactible?: Interactible;
    particleSystemWrapBox?: ParticleSystemWrapBox;
    renderOverlay?: RenderOverlay;
    colliderIsDisabled?: ColliderIsDisabled;
    invisibleOnSignal?: InvisibleOnSignal;
    materialOnSignal?: MaterialOnSignal;
    spawnPrefabOnSignal?: SpawnPrefabOnSignal;
    signalRelay?: SignalRelay;
    adBillboard?: AdBillboard;
    playAnimationOnSignal?: PlayAnimationOnSignal;
}
