Repository: pixijs/pixijs
File: src/rendering/mask/alpha/AlphaMaskPipe.ts (TypeScript)

Code before:
import { TexturePool } from '../../renderers/shared/texture/TexturePool';
import { RendererType } from '../../renderers/types';

import type { Container } from '../../../scene/container/Container';
import type { Effect } from '../../../scene/container/Effect';
import type { PoolItem } from '../../../utils/pool/Pool';
import type { Instruction } from '../../renderers/shared/instructions/Instruction';
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
import type { InstructionPipe } from '../../renderers/shared/instructions/RenderPipe';
import type { RenderTarget } from '../../renderers/shared/renderTarget/RenderTarget';
import type { Renderer } from '../../renderers/types';
import type { AlphaMask } from './AlphaMask';

type MaskMode = 'pushMaskBegin' | 'pushMaskEnd' | 'popMaskBegin' | 'popMaskEnd';

const tempBounds = new Bounds();

class AlphaMaskEffect extends FilterEffect implements PoolItem
{
    constructor()
    {
        super();

        this.filters = [new MaskFilter({
            sprite: new Sprite(Texture.EMPTY),
            resolution: null,
            antialias: 'inherit'
        })];
    }

    get sprite(): Sprite
    {
        return (this.filters[0] as MaskFilter).sprite;
    }

    set sprite(value: Sprite)
    {
        (this.filters[0] as MaskFilter).sprite = value;
    }

    public init: () => void;
}

export interface AlphaMaskInstruction extends Instruction
{
    renderPipeId: 'alphaMask',
    action: MaskMode,
    mask: AlphaMask,
    maskedContainer: Container,
    renderMask: boolean,
}

Review comment (suggestion):
This would be nicer, more readable here:
```suggestion
            resolution: 'inherit',
```


Code after:
import { TexturePool } from '../../renderers/shared/texture/TexturePool';
import { RendererType } from '../../renderers/types';

import type { Container } from '../../../scene/container/Container';
import type { Effect } from '../../../scene/container/Effect';
import type { PoolItem } from '../../../utils/pool/Pool';
import type { Instruction } from '../../renderers/shared/instructions/Instruction';
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
import type { InstructionPipe } from '../../renderers/shared/instructions/RenderPipe';
import type { RenderTarget } from '../../renderers/shared/renderTarget/RenderTarget';
import type { Renderer } from '../../renderers/types';
import type { AlphaMask } from './AlphaMask';

type MaskMode = 'pushMaskBegin' | 'pushMaskEnd' | 'popMaskBegin' | 'popMaskEnd';

const tempBounds = new Bounds();

class AlphaMaskEffect extends FilterEffect implements PoolItem
{
    constructor()
    {
        super();

        this.filters = [new MaskFilter({
            sprite: new Sprite(Texture.EMPTY),
            resolution: 'inherit',
            antialias: 'inherit'
        })];
    }

    get sprite(): Sprite
    {
        return (this.filters[0] as MaskFilter).sprite;
    }

    set sprite(value: Sprite)
    {
        (this.filters[0] as MaskFilter).sprite = value;
    }

    public init: () => void;
}

export interface AlphaMaskInstruction extends Instruction
{
    renderPipeId: 'alphaMask',
    action: MaskMode,
    mask: AlphaMask,
    maskedContainer: Container,
    renderMask: boolean,
}