forked from color-js/color.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Audit function parameter and return types (2/2)
Ensure that functions in the following modules have the correct types and ensure that all color types can be passed as parameters: - inGamut - luminance - set - setAll - space - toGamut
- Loading branch information
Showing
13 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import Color, { ColorTypes } from "./color.js"; | ||
import { ColorTypes, PlainColorObject } from "./color.js"; | ||
import { Ref } from "./space.js"; | ||
|
||
export default function set ( | ||
color: ColorTypes, | ||
prop: Ref, | ||
value: number | ((coord: number) => number) | ||
): Color; | ||
): PlainColorObject; | ||
export default function set ( | ||
color: ColorTypes, | ||
props: Record<string, number | ((coord: number) => number)> | ||
): Color; | ||
): PlainColorObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import Color, { ColorObject } from "./color.js"; | ||
import Color, { ColorTypes, PlainColorObject } from "./color.js"; | ||
import ColorSpace from "./space.js"; | ||
|
||
export default function setAll<T extends Color | ColorObject> ( | ||
color: T, | ||
declare namespace setAll { | ||
let returns: "color"; | ||
} | ||
|
||
declare function setAll ( | ||
color: ColorTypes, | ||
space: string | ColorSpace, | ||
coords: [number, number, number] | ||
): T; | ||
): PlainColorObject; | ||
|
||
export default setAll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters