Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

calc-image-stats

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calc-image-stats - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

56

calc-image-stats.d.ts

@@ -1,21 +0,23 @@

export type BandStats = {
count?: number;
valid?: number;
invalid?: number;
median?: number;
min?: number;
max?: number;
sum?: number;
range?: number;
mean?: number;
std?: number;
modes?: number[];
mode?: number;
export type BandStats<P extends boolean> = {
count?: P extends true ? string : number;
valid?: P extends true ? string : number;
invalid?: P extends true ? string : number;
median?: P extends true ? string : number;
min?: P extends true ? string : number;
max?: P extends true ? string : number;
sum?: P extends true ? string : number;
range?: P extends true ? string : number;
mean?: P extends true ? string : number;
std?: P extends true ? string : number;
modes?: P extends true ? string[] : number[];
mode?: P extends true ? string : number;
variance?: P extends true ? string : number;
uniques?: P extends true ? string[] : number[];
};
export type ImageStats = {
export type ImageStats<P extends boolean> = {
depth: number;
height: number;
width: number;
bands: BandStats[];
bands: BandStats<P>[];
};

@@ -25,15 +27,13 @@

export type Options = {
bands?: number;
height?: number;
precise?: boolean;
stats?: string[];
layout?: string;
width?: number;
[rest: string]: any;
};
export default function calcImageStats(
export default function calcImageStats<P extends boolean>(
data: ImageData,
options?: Options
): ImageStats;
options?: {
bands?: number;
height?: number;
precise?: P;
stats?: string[];
layout?: string;
width?: number;
[rest: string]: any;
}
): P extends true ? ImageStats<P> : ImageStats<false>;
{
"name": "calc-image-stats",
"version": "0.5.0",
"version": "0.6.0",
"description": "Calculate Band Statistics for an Image",

@@ -5,0 +5,0 @@ "main": "calc-image-stats.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc