flipnote.js
Advanced tools
Comparing version 5.5.1 to 5.6.0
@@ -29,5 +29,4 @@ import { LitElement } from 'lit-element'; | ||
disconnectedCallback(): void; | ||
private getTitle; | ||
private dispatchLoad; | ||
private dispatchError; | ||
} |
@@ -6,6 +6,6 @@ import { LitElement, PropertyValues } from 'lit-element'; | ||
player: Player; | ||
readonly renderer: import("../renderers").WebglCanvas; | ||
readonly renderer: import("../renderers").UniversalCanvas; | ||
readonly audio: import("../webaudio").WebAudioPlayer; | ||
readonly canvasEl: HTMLCanvasElement; | ||
readonly note: import("../parsers").FlipnoteParser; | ||
readonly note: import("../parsers").FlipnoteParserBase; | ||
readonly noteFormat: import("../parsers").FlipnoteFormat; | ||
@@ -50,3 +50,3 @@ readonly meta: import("../parsers").FlipnoteMeta; | ||
closeNote(): void; | ||
openNote(note: import("../parsers").FlipnoteParser): void; | ||
openNote(note: import("../parsers").FlipnoteParserBase): void; | ||
playbackLoop: (timestamp: number) => void; | ||
@@ -53,0 +53,0 @@ setCurrentTime(value: number): void; |
@@ -19,6 +19,6 @@ import { Player } from '../player'; | ||
player: Player; | ||
readonly renderer: import("../renderers").WebglCanvas; | ||
readonly renderer: import("../renderers").UniversalCanvas; | ||
readonly audio: import("../webaudio").WebAudioPlayer; | ||
readonly canvasEl: HTMLCanvasElement; | ||
readonly note: import("../parsers").FlipnoteParser; | ||
readonly note: import("../parsers").FlipnoteParserBase; | ||
readonly noteFormat: import("../parsers").FlipnoteFormat; | ||
@@ -63,3 +63,3 @@ readonly meta: import("../parsers").FlipnoteMeta; | ||
closeNote(): void; | ||
openNote(note: import("../parsers").FlipnoteParser): void; | ||
openNote(note: import("../parsers").FlipnoteParserBase): void; | ||
playbackLoop: (timestamp: number) => void; | ||
@@ -66,0 +66,0 @@ setCurrentTime(value: number): void; |
@@ -1,2 +0,2 @@ | ||
export { Flipnote, FlipnoteFormat, FlipnoteVersion, FlipnoteRegion, FlipnoteMeta, FlipnoteAudioTrack, FlipnoteAudioTrackInfo, FlipnotePaletteDefinition, FlipnotePaletteColor, FlipnoteLayerVisibility, FlipnoteParserSettings, KwzParserSettings, PpmParserSettings, KwzParser, PpmParser } from './parsers'; | ||
export { Flipnote, FlipnoteFormat, FlipnoteVersion, FlipnoteRegion, FlipnoteMeta, FlipnotePaletteColor, FlipnotePaletteDefinition, FlipnoteLayerVisibility, FlipnoteAudioTrack, FlipnoteAudioTrackInfo, FlipnoteSoundEffectTrack, FlipnoteSoundEffectFlags, FlipnoteParserSettings, KwzParserSettings, PpmParserSettings, KwzParser, PpmParser } from './parsers'; | ||
export * as utils from './utils/fsid'; | ||
@@ -7,6 +7,7 @@ export { parseSource } from './parseSource'; | ||
export { GifImage, WavAudio, } from './encoders'; | ||
export { WebglCanvas } from './renderers'; | ||
export { CanvasInterface, WebglCanvas, Html5Canvas, UniversalCanvas } from './renderers'; | ||
export { WebAudioPlayer } from './webaudio'; | ||
/** | ||
* flipnote.js library version (exported as `flipnote.version`). You can find the latest version on the project's [NPM](https://www.npmjs.com/package/flipnote.js) page. | ||
*/ | ||
export declare const version = "5.5.1"; | ||
export declare const version = "5.6.0"; |
@@ -1,2 +0,2 @@ | ||
import { FlipnoteParser } from './FlipnoteParserTypes'; | ||
import { FlipnoteParserBase } from './FlipnoteParserBase'; | ||
import { PpmParserSettings } from './PpmParser'; | ||
@@ -7,2 +7,2 @@ import { KwzParserSettings } from './KwzParser'; | ||
/** Flipnote type. An object with this type is guranteed to implement the {@link FlipnoteParser} API. */ | ||
export declare type Flipnote = FlipnoteParser; | ||
export declare type Flipnote = FlipnoteParserBase; |
@@ -1,4 +0,4 @@ | ||
export * from './FlipnoteParserTypes'; | ||
export * from './FlipnoteParserBase'; | ||
export * from './FlipnoteTypes'; | ||
export * from './PpmParser'; | ||
export * from './KwzParser'; |
@@ -1,2 +0,2 @@ | ||
import { FlipnoteFormat, FlipnoteAudioTrack, FlipnoteMeta, FlipnoteParser } from './FlipnoteParserTypes'; | ||
import { FlipnoteFormat, FlipnoteAudioTrack, FlipnoteSoundEffectTrack, FlipnoteSoundEffectFlags, FlipnoteMeta, FlipnoteParserBase } from './FlipnoteParserBase'; | ||
/** | ||
@@ -81,3 +81,3 @@ * KWZ section types | ||
*/ | ||
export declare class KwzParser extends FlipnoteParser { | ||
export declare class KwzParser extends FlipnoteParserBase { | ||
/** Default KWZ parser settings */ | ||
@@ -99,6 +99,12 @@ static defaultSettings: KwzParserSettings; | ||
static sampleRate: number; | ||
/** Which audio tracks are available in this format */ | ||
static audioTracks: FlipnoteAudioTrack[]; | ||
/** Which sound effect tracks are available in this format */ | ||
static soundEffectTracks: FlipnoteSoundEffectTrack[]; | ||
/** Global animation frame color palette */ | ||
static globalPalette: import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
static globalPalette: import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
/** File format type, reflects {@link KwzParser.format} */ | ||
format: FlipnoteFormat; | ||
/** Custom object tag */ | ||
[Symbol.toStringTag]: string; | ||
/** Animation frame width, reflects {@link KwzParser.width} */ | ||
@@ -118,2 +124,6 @@ imageWidth: number; | ||
srcWidth: number; | ||
/** Which audio tracks are available in this format, reflects {@link KwzParser.audioTracks} */ | ||
audioTracks: FlipnoteAudioTrack[]; | ||
/** Which sound effect tracks are available in this format, reflects {@link KwzParser.soundEffectTracks} */ | ||
soundEffectTracks: FlipnoteSoundEffectTrack[]; | ||
/** Audio track base sample rate, reflects {@link KwzParser.rawSampleRate} */ | ||
@@ -124,3 +134,3 @@ rawSampleRate: number; | ||
/** Global animation frame color palette, reflects {@link KwzParser.globalPalette} */ | ||
globalPalette: import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
globalPalette: import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
/** File metadata, see {@link KwzMeta} for structure */ | ||
@@ -132,2 +142,3 @@ meta: KwzMeta; | ||
private layerBuffers; | ||
private soundFlags; | ||
private prevDecodedFrame; | ||
@@ -180,3 +191,3 @@ private frameMetaOffsets; | ||
*/ | ||
getFramePalette(frameIndex: number): import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
getFramePalette(frameIndex: number): import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
private getFrameDiffingFlag; | ||
@@ -186,3 +197,3 @@ private getFrameLayerSizes; | ||
private getFrameAuthor; | ||
private getFrameSoundFlags; | ||
private decodeFrameSoundFlags; | ||
private getFrameCameraFlags; | ||
@@ -206,2 +217,13 @@ /** | ||
/** | ||
* Get the sound effect usage flags for every frame | ||
* @category Audio | ||
*/ | ||
getSoundEffectFlags(): FlipnoteSoundEffectFlags[]; | ||
/** | ||
* Get the sound effect usage for a given frame | ||
* @param frameIndex | ||
* @category Audio | ||
*/ | ||
getFrameSoundEffectFlags(frameIndex: number): FlipnoteSoundEffectFlags; | ||
/** | ||
* Get the raw compressed audio data for a given track | ||
@@ -208,0 +230,0 @@ * @returns Byte array |
@@ -24,3 +24,3 @@ /** | ||
*/ | ||
import { FlipnoteFormat, FlipnoteAudioTrack, FlipnoteMeta, FlipnoteParser } from './FlipnoteParserTypes'; | ||
import { FlipnoteFormat, FlipnoteAudioTrack, FlipnoteSoundEffectTrack, FlipnoteSoundEffectFlags, FlipnoteMeta, FlipnoteParserBase } from './FlipnoteParserBase'; | ||
/** | ||
@@ -44,3 +44,3 @@ * PPM file metadata, stores information about its playback, author details, etc | ||
*/ | ||
export declare class PpmParser extends FlipnoteParser { | ||
export declare class PpmParser extends FlipnoteParserBase { | ||
/** Default PPM parser settings */ | ||
@@ -62,6 +62,12 @@ static defaultSettings: PpmParserSettings; | ||
static sampleRate: number; | ||
/** Which audio tracks are available in this format */ | ||
static audioTracks: FlipnoteAudioTrack[]; | ||
/** Which sound effect tracks are available in this format */ | ||
static soundEffectTracks: FlipnoteSoundEffectTrack[]; | ||
/** Global animation frame color palette */ | ||
static globalPalette: import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
static globalPalette: import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
/** File format type, reflects {@link PpmParser.format} */ | ||
format: FlipnoteFormat; | ||
/** Custom object tag */ | ||
[Symbol.toStringTag]: string; | ||
/** Animation frame width, reflects {@link PpmParser.width} */ | ||
@@ -81,2 +87,6 @@ imageWidth: number; | ||
srcWidth: number; | ||
/** Which audio tracks are available in this format, reflects {@link PpmParser.audioTracks} */ | ||
audioTracks: FlipnoteAudioTrack[]; | ||
/** Which sound effect tracks are available in this format, reflects {@link PpmParser.soundEffectTracks} */ | ||
soundEffectTracks: FlipnoteSoundEffectTrack[]; | ||
/** Audio track base sample rate, reflects {@link PpmParser.rawSampleRate} */ | ||
@@ -87,3 +97,3 @@ rawSampleRate: number; | ||
/** Global animation frame color palette, reflects {@link PpmParser.globalPalette} */ | ||
globalPalette: import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
globalPalette: import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
/** File metadata, see {@link PpmMeta} for structure */ | ||
@@ -94,2 +104,3 @@ meta: PpmMeta; | ||
private layerBuffers; | ||
private soundFlags; | ||
private prevLayerBuffers; | ||
@@ -144,3 +155,3 @@ private lineEncodingBuffers; | ||
*/ | ||
getFramePalette(frameIndex: number): import("./FlipnoteParserTypes").FlipnotePaletteColor[]; | ||
getFramePalette(frameIndex: number): import("./FlipnoteParserBase").FlipnotePaletteColor[]; | ||
/** | ||
@@ -150,4 +161,14 @@ * Get the sound effect flags for every frame in the Flipnote | ||
*/ | ||
decodeSoundFlags(): any[]; | ||
decodeSoundFlags(): boolean[][]; | ||
/** | ||
* Get the sound effect usage flags for every frame | ||
* @category Audio | ||
*/ | ||
getSoundEffectFlags(): FlipnoteSoundEffectFlags[]; | ||
/** | ||
* Get the sound effect usage flags for a given frame | ||
* @category Audio | ||
*/ | ||
getFrameSoundEffectFlags(frameIndex: number): FlipnoteSoundEffectFlags; | ||
/** | ||
* Get the raw compressed audio data for a given track | ||
@@ -154,0 +175,0 @@ * @returns byte array |
import { Flipnote, FlipnoteFormat, FlipnoteMeta } from '../parsers'; | ||
import { FlipnoteSource } from '../parseSource'; | ||
import { PlayerEvent, PlayerEventMap } from './PlayerEvent'; | ||
import { WebglCanvas } from '../renderers'; | ||
import { UniversalCanvas } from '../renderers'; | ||
import { WebAudioPlayer } from '../webaudio'; | ||
@@ -45,3 +45,3 @@ declare type PlayerLayerVisibility = Record<number, boolean>; | ||
/** Frame renderer */ | ||
renderer: WebglCanvas; | ||
renderer: UniversalCanvas; | ||
/** Audio player */ | ||
@@ -48,0 +48,0 @@ audio: WebAudioPlayer; |
@@ -0,1 +1,4 @@ | ||
export * from './CanvasInterface'; | ||
export * from './WebGlCanvas'; | ||
export * from './Html5Canvas'; | ||
export * from './UniversalCanvas'; |
@@ -1,3 +0,7 @@ | ||
import { FlipnoteParser } from '../parsers'; | ||
interface WebglCanvasOptions { | ||
import { FlipnoteParserBase } from '../parsers'; | ||
import { CanvasInterface } from './CanvasInterface'; | ||
/** | ||
* Settings for {@link WebGlCanvas} | ||
*/ | ||
export interface WebglCanvasOptions { | ||
/** Function to be called if the context is lost */ | ||
@@ -11,10 +15,13 @@ onlost: () => void; | ||
/** | ||
* Animation frame renderer, built around the {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API WebGL} API | ||
* Flipnote renderer for the {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API WebGL} API | ||
* | ||
* Only available in browser contexts | ||
*/ | ||
export declare class WebglCanvas { | ||
export declare class WebglCanvas implements CanvasInterface { | ||
static defaultOptions: WebglCanvasOptions; | ||
static isSupported(): boolean; | ||
/** */ | ||
note: FlipnoteParserBase; | ||
/** Canvas HTML element being used as a rendering surface */ | ||
el: HTMLCanvasElement; | ||
canvas: HTMLCanvasElement; | ||
/** Rendering context - see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext} */ | ||
@@ -26,2 +33,6 @@ gl: WebGLRenderingContext; | ||
height: number; | ||
/** */ | ||
srcWidth: number; | ||
/** */ | ||
srcHeight: number; | ||
/** | ||
@@ -31,3 +42,3 @@ * Backing canvas width (real pixels) | ||
*/ | ||
screenWidth: number; | ||
dstWidth: number; | ||
/** | ||
@@ -37,3 +48,5 @@ * Backing canvas height (real pixels) | ||
*/ | ||
screenHeight: number; | ||
dstHeight: number; | ||
/** */ | ||
prevFrameIndex: number; | ||
private options; | ||
@@ -46,4 +59,2 @@ private program; | ||
private frameTexture; | ||
private textureWidth; | ||
private textureHeight; | ||
private refs; | ||
@@ -79,6 +90,15 @@ private isCtxLost; | ||
*/ | ||
setInputSize(width: number, height: number): void; | ||
clear(): void; | ||
drawFrame(note: FlipnoteParser, frameIndex: number): void; | ||
setNote(note: FlipnoteParserBase): void; | ||
/** | ||
* Clear the canvas | ||
* @param color optional RGBA color to use as a background color | ||
*/ | ||
clear(color?: [number, number, number, number]): void; | ||
/** | ||
* Draw a frame from the currently loaded Flipnote | ||
* @param frameIndex | ||
*/ | ||
drawFrame(frameIndex: number): void; | ||
forceUpdate(): void; | ||
/** | ||
* Returns true if the webGL context has returned an error | ||
@@ -91,10 +111,16 @@ */ | ||
*/ | ||
isLost(): boolean; | ||
private checkContextLoss; | ||
private handleContextLoss; | ||
private handleContextRestored; | ||
/** | ||
* | ||
* @param type image mime type (`image/jpeg`, `image/png`, etc) | ||
* @param quality image quality where supported, between 0 and 1 | ||
*/ | ||
getDataUrl(type?: string, quality?: any): string; | ||
getBlob(type?: string, quality?: any): Promise<Blob>; | ||
/** | ||
* Frees any resources used by this canvas instance | ||
*/ | ||
destroy(): Promise<void>; | ||
destroy(): void; | ||
} | ||
export {}; |
@@ -15,4 +15,8 @@ /** PCM audio buffer types. Supports s16_le, or float32_le with a range of -1.0 to 1.0 */ | ||
useEq: boolean; | ||
/** Whether to connect the output to an audio analyser (see {@link analyser}) */ | ||
useAnalyser: boolean; | ||
/** Default equalizer settings. Credit to {@link https://www.sudomemo.net/ | Sudomemo} for these */ | ||
eqSettings: [number, number][]; | ||
/** If enabled, provides audio analysis for visualisation etc - https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API */ | ||
analyser: AnalyserNode; | ||
private _volume; | ||
@@ -40,2 +44,3 @@ private _loop; | ||
private initNodes; | ||
setAnalyserEnabled(on: boolean): void; | ||
/** | ||
@@ -58,5 +63,5 @@ * Sets the audio volume level | ||
/** | ||
* Frees any resources used by this canvas instance | ||
*/ | ||
* Frees any resources used by this canvas instance | ||
*/ | ||
destroy(): Promise<void>; | ||
} |
{ | ||
"name": "flipnote.js", | ||
"version": "5.5.1", | ||
"version": "5.6.0", | ||
"description": "A JavaScript library for parsing, converting, and in-browser playback of the proprietary animation formats used by Nintendo's Flipnote Studio and Flipnote Studio 3D apps.", | ||
@@ -5,0 +5,0 @@ "module": "dist/flipnote.es.js", |
@@ -18,9 +18,9 @@ <h1 align="center"><a href="//flipnote.js.org" target="blank"><img width="838px" src="https://raw.githubusercontent.com/jaames/flipnote.js/master/assets/ghbanner@2x.png"/></a></h1> | ||
* Full file parser implementations with metadata, frames, audio, signature verification, etc | ||
* Realtime browser-based playback, with a player API based on the HTML5 Video and Audio APIs | ||
* Realtime browser-based playback for frames and audio, with a player API based on the HTML5 Video and Audio APIs | ||
* Optional web component for easily embedding a Flipnote player UI on any web page | ||
* Crisp scaling using sharp-bilinear filtering | ||
* WebGL renderer with crisp pixel scaling (using sharp-bilinear filtering!), with a HTML5 canvas fallback | ||
* Built-in GIF and WAV converters | ||
* Works in web browser and NodeJS environments | ||
* Exports full Typescript types | ||
* 20kb minified & gzipped | ||
* 23kb minified & gzipped | ||
@@ -27,0 +27,0 @@ ## Background |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1293601
26777