Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Jan 10, 2024
1 parent d531c8d commit 309cd3c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ window.open(URL.createObjectURL(blob))

## Types

See the [gif.ts](src/gif.ts)
See the [types.ts](src/types.ts)

## Encode Options

Expand Down
3 changes: 2 additions & 1 deletion src/Encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Logger } from './Logger'
import { CropIndexedFrame, EncodeGif, EncodeIndexdFrame, FrameToIndexedFrame } from './transformers'
import { loadImage, resovleSource } from './utils'
import { createWorker } from './create-worker'
import type { EncoderOptions, EncodingFrame, UnencodedFrame } from './types'
import type { EncoderOptions } from './options'
import type { EncodingFrame, UnencodedFrame } from './types'

export interface EncoderConfig extends EncoderOptions {
maxColors: number
Expand Down
2 changes: 1 addition & 1 deletion src/encode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Encoder } from './Encoder'
import type { EncoderOptions } from './types'
import type { EncoderOptions } from './options'

export function encode(options: EncoderOptions & { format: 'blob' }): Promise<Blob>
export function encode(options: EncoderOptions & { format?: 'arrayBuffer' }): Promise<ArrayBuffer>
Expand Down
20 changes: 20 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Gif, UnencodedFrame } from './types'

export interface EncoderOptions extends Partial<Omit<Gif, 'width' | 'height' | 'frames'>> {
/** GIF width */
width: number
/** GIF height */
height: number
/** The frames that needs to be encoded */
frames?: Array<UnencodedFrame>
/** Enable debug mode to view the execution time log */
debug?: boolean
/** Worker script url */
workerUrl?: string
/** Max colors count 2-255 */
maxColors?: number
/** Palette premultipliedAlpha */
premultipliedAlpha?: boolean
/** Palette tint */
tint?: Array<number>
}
19 changes: 0 additions & 19 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,3 @@ export interface Gif89a extends Gif87a {
export interface Gif extends Gif89a {
version: '89a' | '87a'
}

export interface EncoderOptions extends Partial<Omit<Gif, 'width' | 'height' | 'frames'>> {
/** GIF width */
width: number
/** GIF height */
height: number
/** The frames that needs to be encoded */
frames?: Array<UnencodedFrame>
/** Enable debug mode to view the execution time log */
debug?: boolean
/** Worker script url */
workerUrl?: string
/** Max colors count 2-255 */
maxColors?: number
/** Palette premultipliedAlpha */
premultipliedAlpha?: boolean
/** Palette tint */
tint?: Array<number>
}

1 comment on commit 309cd3c

@vercel
Copy link

@vercel vercel bot commented on 309cd3c Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

modern-gif – ./

modern-gif-git-main-qq15725.vercel.app
modern-gif-qq15725.vercel.app
modern-gif.vercel.app

Please sign in to comment.