Skip to content

Incorrect pixiApplication.init(), ApplicationOptions Layout typings. #124

@inlinecoder

Description

@inlinecoder

PixiJS Layout version

3.2.0

PixiJS version

8.14.0

Link to minimal reproduction

https://stackblitz.com/edit/pixijs-layout-qs1nwcur?file=package.json,src%2Freproduction.ts

Steps to reproduce

Hello guys,

As per documentation, when we init the app, we can provide layout props

await self.pixiApplication.init({
  resizeTo: self.wrapper,
  resolution: self.environment.devicePixelRatio,
  backgroundColor: 0x2c3e50,
  useBackBuffer: true,
  autoDensity: true,
  layout: {
    autoUpdate: true, // HERE
    enableDebug: true,
    throttle: 100,
    debugModificationCount: 1,
  },
});

However, the current typing system makes TypeScript to accept

layout: {
  layout: { // NESTED INSTEAD
  }
}

What is expected?

Expected to have types which do reflect ApplicationsOptions like in the documentation.

  autoUpdate: true, // HERE
  enableDebug: true,
  throttle: 100,
  debugModificationCount: 1,

What is actually happening?

TypeScript complains:
TS2353: Object literal may only specify known properties, and autoUpdate does not exist in type LayoutSystemOption.

Environment

  • Browser & Version: Chrome 108
  • OS & Version: MacOS Tahoe

Any additional comments?

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions