flipnote.js
Advanced tools
Comparing version 5.7.0 to 5.8.0
@@ -34,2 +34,4 @@ import { LitElement, PropertyValues } from 'lit-element'; | ||
isSeeking: boolean; | ||
lastParser: import("../parseSource").FlipnoteSourceParser<import("../parseSource").FlipnoteSource>; | ||
lastLoaders: import("../loaders").LoaderDefinitionList; | ||
src: import("../parseSource").FlipnoteSource; | ||
@@ -51,3 +53,3 @@ paused: boolean; | ||
readonly videoHeight: number; | ||
load(source?: any): Promise<void>; | ||
load(source: any, getParser: import("../parseSource").FlipnoteSourceParser<import("../parseSource").FlipnoteSource>, loaders?: import("../loaders").LoaderDefinitionList): Promise<void>; | ||
reload(): Promise<void>; | ||
@@ -54,0 +56,0 @@ updateSettings(settings: Partial<import("../parsers").KwzParserSettings>): Promise<void>; |
@@ -47,2 +47,4 @@ import { Player } from '../player'; | ||
isSeeking: boolean; | ||
lastParser: import("../parseSource").FlipnoteSourceParser<import("../parseSource").FlipnoteSource>; | ||
lastLoaders: import("../loaders").LoaderDefinitionList; | ||
src: import("../parseSource").FlipnoteSource; | ||
@@ -64,3 +66,3 @@ paused: boolean; | ||
readonly videoHeight: number; | ||
load(source?: any): Promise<void>; | ||
load(source: any, getParser: import("../parseSource").FlipnoteSourceParser<import("../parseSource").FlipnoteSource>, loaders?: import("../loaders").LoaderDefinitionList): Promise<void>; | ||
reload(): Promise<void>; | ||
@@ -67,0 +69,0 @@ updateSettings(settings: Partial<import("../parsers").KwzParserSettings>): Promise<void>; |
@@ -15,7 +15,11 @@ import { LitElement } from 'lit-element'; | ||
render(): import("lit-element").TemplateResult; | ||
onSliderInputStart: (event: MouseEvent) => void; | ||
onSliderInputEnd: (event: MouseEvent) => void; | ||
onSliderInput: (event: MouseEvent) => void; | ||
onSliderMouseStart: (event: MouseEvent) => void; | ||
onSliderMouseEnd: (event: MouseEvent) => void; | ||
onSliderMouseMove: (event: MouseEvent) => void; | ||
onSliderTouchStart: (event: TouchEvent) => void; | ||
onSliderTouchEnd: (event: TouchEvent) => void; | ||
onSliderTouchMove: (event: TouchEvent) => void; | ||
onSliderInput: (x: number, y: number) => void; | ||
private dispatch; | ||
} | ||
export {}; |
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'; | ||
export { parseSource } from './parseSource'; | ||
export * from './loaders'; | ||
export * from './parseSource'; | ||
export { Player, PlayerEvent, } from './player'; | ||
@@ -5,0 +6,0 @@ export { PlayerMixin } from './components/PlayerMixin'; |
import { LoaderDefinition } from './LoaderDefinition'; | ||
/** | ||
* Loader for ArrayBuffer objects | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const arrayBufferLoader: LoaderDefinition<ArrayBuffer>; | ||
export default arrayBufferLoader; |
import { LoaderDefinition } from './LoaderDefinition'; | ||
/** | ||
* Loader for Blob objects (browser only) | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const blobLoader: LoaderDefinition<Blob>; | ||
export default blobLoader; |
import { LoaderDefinition } from './LoaderDefinition'; | ||
/** | ||
* Loader for File objects (browser only) | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const fileLoader: LoaderDefinition<File>; | ||
export default fileLoader; |
@@ -0,2 +1,16 @@ | ||
import { LoaderDefinition } from './LoaderDefinition'; | ||
export * from './LoaderDefinition'; | ||
export * from './webUrlLoader'; | ||
export * from './nodeUrlLoader'; | ||
export * from './fileLoader'; | ||
export * from './blobLoader'; | ||
export * from './nodeBufferLoader'; | ||
export * from './arrayBufferLoader'; | ||
/** | ||
* A list of {@link LoaderDefinition} items to use when attempting to load a Flipnote. | ||
* Loaders are tried in sequence until a matching one is found for the requested input. | ||
* @category Loaders | ||
*/ | ||
export declare type LoaderDefinitionList = LoaderDefinition<any>[]; | ||
/** @internal */ | ||
export declare function loadSource(source: any): Promise<ArrayBuffer>; | ||
export declare function loadSource(source: any, loaders?: LoaderDefinitionList): Promise<ArrayBuffer>; |
@@ -1,10 +0,16 @@ | ||
/** @internal */ | ||
declare type LoaderResolve = (result: ArrayBuffer) => void; | ||
/** @internal */ | ||
declare type LoaderReject = (err?: any) => void; | ||
/** | ||
* Resolution function passed to a loader's `load` method. Call when a Flipnote has been loaded successfully. | ||
* The result should be Flipnote file data as an ArrayBuffer. | ||
* @category Loader | ||
*/ | ||
export declare type LoaderResolve = (result: ArrayBuffer) => void; | ||
/** | ||
* Rejection function passed to a loader's `load` method. Call when a Flipnote couldn't be loaded. | ||
* @category Loader | ||
*/ | ||
export declare type LoaderReject = (err?: any) => void; | ||
/** | ||
* Loader interface | ||
* | ||
* The goal of each loader is to be able to tell when it can handle a particular source type, and resolve an ArrayBuffer for that source | ||
* @internal | ||
* The goal of a loader is to be able to tell when it can handle a particular source type, and then resolve an ArrayBuffer for that source. | ||
* @category Loader | ||
*/ | ||
@@ -17,2 +23,1 @@ export interface LoaderDefinition<T> { | ||
} | ||
export {}; |
@@ -5,5 +5,5 @@ /// <reference types="node" /> | ||
* Loader for Buffer objects (Node only) | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const nodeBufferLoader: LoaderDefinition<Buffer>; | ||
export default nodeBufferLoader; |
import { LoaderDefinition } from './LoaderDefinition'; | ||
/** | ||
* Loader for web url strings (Node only) | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const nodeUrlLoader: LoaderDefinition<string>; | ||
export default nodeUrlLoader; |
import { LoaderDefinition } from './LoaderDefinition'; | ||
/** | ||
* Loader for web url strings (Browser only) | ||
* @internal | ||
* @category Loader | ||
*/ | ||
declare const webUrlLoader: LoaderDefinition<string>; | ||
export default webUrlLoader; |
/// <reference types="node" /> | ||
import { LoaderDefinitionList } from './loaders'; | ||
import { Flipnote, FlipnoteParserSettings } from './parsers'; | ||
@@ -12,6 +13,10 @@ /** | ||
/** | ||
* Implements loading a Flipnote from a given source type, and returns a promise which resolves to a {@link Flipnote} parser instance. | ||
*/ | ||
export declare type FlipnoteSourceParser<S = FlipnoteSource> = (source: S, parserConfig?: Partial<FlipnoteParserSettings>, loaders?: LoaderDefinitionList) => Promise<Flipnote>; | ||
/** | ||
* Load a Flipnote from a given source, returning a promise with a parser object. | ||
* It will auto-detect the Flipnote format and return either a {@link PpmParser} or {@link KwzParser} accordingly. | ||
* | ||
* @param source - Source to load a Flipnote from. Depending on the operating envionment, this can be: | ||
* @param source - Source to load a Flipnote from. Depending on the operating environment, this can be: | ||
* - A string representing a web URL | ||
@@ -21,4 +26,6 @@ * - An {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer} | ||
* - A {@link https://nodejs.org/api/buffer.html | Buffer} object (NodeJS only) | ||
* You can also pass your own list of loaders to support your own source types. | ||
* @param parserConfig - Config settings to pass to the parser, see {@link FlipnoteParserSettings} | ||
* @param loaders - Optional list of file loaders ({@link LoaderDefinition}) when attempting to load a Flipnote. Loaders are tried in sequence until a matching one is found for the requested input. | ||
*/ | ||
export declare function parseSource(source: FlipnoteSource, parserConfig?: Partial<FlipnoteParserSettings>): Promise<Flipnote>; | ||
export declare const parseSource: FlipnoteSourceParser; |
@@ -1,3 +0,4 @@ | ||
import { Flipnote, FlipnoteFormat, FlipnoteMeta, FlipnoteParserSettings } from '../parsers'; | ||
import { FlipnoteSource } from '../parseSource'; | ||
import type { Flipnote, FlipnoteFormat, FlipnoteMeta, FlipnoteParserSettings } from '../parsers'; | ||
import type { FlipnoteSource, FlipnoteSourceParser } from '../parseSource'; | ||
import type { LoaderDefinitionList } from '../loaders'; | ||
import { PlayerEvent, PlayerEventMap } from './PlayerEvent'; | ||
@@ -100,2 +101,6 @@ import { UniversalCanvas } from '../renderers'; | ||
isSeeking: boolean; | ||
/** @internal */ | ||
lastParser: FlipnoteSourceParser; | ||
/** @internal */ | ||
lastLoaders: LoaderDefinitionList; | ||
/** | ||
@@ -111,3 +116,3 @@ * Create a new Player instance | ||
constructor(parent: string | Element, width: number, height: number, parserSettings?: FlipnoteParserSettings); | ||
/** The currently loaded Flipnote source, if there is one. Can be overridden to load another Flipnote */ | ||
/** The currently loaded Flipnote source, if there is one */ | ||
get src(): FlipnoteSource; | ||
@@ -171,3 +176,3 @@ set src(source: FlipnoteSource); | ||
*/ | ||
load(source?: any): Promise<void>; | ||
load(source: any, getParser: FlipnoteSourceParser, loaders?: LoaderDefinitionList): Promise<void>; | ||
/** | ||
@@ -174,0 +179,0 @@ * Reload the current Flipnote |
/*!! | ||
flipnote.js v5.7.0 | ||
flipnote.js v5.8.0 | ||
https://flipnote.js.org | ||
@@ -344,3 +344,3 @@ 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. | ||
function timeGetNoteDuration(frameCount, framerate) { | ||
// multiply and devide by 100 to get around floating precision issues | ||
// multiply and divide by 100 to get around floating precision issues | ||
return ((frameCount * 100) * (1 / framerate)) / 100; | ||
@@ -347,0 +347,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { FlipnoteParserBase } from '../parsers'; | ||
import type { FlipnoteParserBase } from '../parsers'; | ||
/** @internal */ | ||
@@ -3,0 +3,0 @@ export declare abstract class CanvasInterface { |
@@ -1,2 +0,2 @@ | ||
import { FlipnoteParserBase } from '../parsers'; | ||
import type { FlipnoteParserBase } from '../parsers'; | ||
import { CanvasInterface } from './CanvasInterface'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { FlipnoteParserBase } from '../parsers'; | ||
import type { FlipnoteParserBase } from '../parsers'; | ||
import { CanvasInterface } from './CanvasInterface'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -8,4 +8,5 @@ export * from './ByteArray'; | ||
export * from './assert'; | ||
export * from './promises'; | ||
export * from './datetime'; | ||
export * from './fsid'; | ||
export * from './saveData'; |
{ | ||
"name": "flipnote.js", | ||
"version": "5.7.0", | ||
"version": "5.8.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", |
@@ -51,5 +51,6 @@ <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> | ||
* [Flipnote Archive](https://archive.sudomemo.net/) - an archive of Flipnote animations posted to Flipnote Hatena before its closure in 2013 | ||
* [Flipnote Player](http://flipnote.rakujira.jp/) - web-based browser, player and converter for Flipnote animations | ||
* [Kaeru Gallery](https://gallery.kaeru.world/) - fan-made replacement online service for Flipnote Studio 3D | ||
* [flipnote-video](https://github.com/jaames/flipnote-video) - command line tool for converting Flipnotes to video | ||
* [Kaeru Gallery](https://gallery.kaeru.world/) - fan-made replacement online service for Flipnote Studio 3D | ||
* [IPGFlip](https://ipgflip.xyz/) - fan-made replacement online service for Flipnote Studio |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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 not supported yet
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
4331088
69
39323
55