@@ -295,15 +295,15 @@ function checkChangeDeprecations(
295
295
[ key in ChannelName ] ?: number | null ;
296
296
} ,
297
297
channels : ChannelName [ ]
298
- ) {
298
+ ) : void {
299
299
if ( options . alpha === null ) emitNullAlphaDeprecation ( ) ;
300
300
for ( const channel of channels ) {
301
301
if ( options [ channel ] === null ) emitColor4ApiChangeNullDeprecation ( channel ) ;
302
302
}
303
303
}
304
304
305
305
/** Warn users about legacy color channel getters. */
306
- function emitColor4ApiGetterDeprecation ( name : string ) {
306
+ function emitColor4ApiGetterDeprecation ( name : string ) : void {
307
307
console . warn (
308
308
'Deprecation [color-4-api]: ' +
309
309
`\`${ name } \` is deprecated, use \`channel\` instead.` +
@@ -316,7 +316,7 @@ function emitColor4ApiGetterDeprecation(name: string) {
316
316
* Warn users about changing channels not in the current color space without
317
317
* explicitly setting `space`.
318
318
*/
319
- function emitColor4ApiChangeSpaceDeprecation ( ) {
319
+ function emitColor4ApiChangeSpaceDeprecation ( ) : void {
320
320
console . warn (
321
321
'Deprecation [color-4-api]: ' +
322
322
"Changing a channel not in this color's space without explicitly " +
@@ -327,7 +327,7 @@ function emitColor4ApiChangeSpaceDeprecation() {
327
327
}
328
328
329
329
/** Warn users about `null` channel values without setting `space`. */
330
- function emitColor4ApiChangeNullDeprecation ( channel : string ) {
330
+ function emitColor4ApiChangeNullDeprecation ( channel : string ) : void {
331
331
console . warn (
332
332
'Deprecation [color-4-api]: ' +
333
333
`Passing \`${ channel } : null\` without setting \`space\` is deprecated.` +
@@ -337,7 +337,7 @@ function emitColor4ApiChangeNullDeprecation(channel: string) {
337
337
}
338
338
339
339
/** Warn users about null-alpha deprecation. */
340
- function emitNullAlphaDeprecation ( ) {
340
+ function emitNullAlphaDeprecation ( ) : void {
341
341
console . warn (
342
342
'Deprecation [null-alpha]: ' +
343
343
'Passing `alpha: null` without setting `space` is deprecated.' +
@@ -375,7 +375,7 @@ export class SassColor extends Value {
375
375
private channel2Id ! : ChannelName ;
376
376
377
377
// Sets channel names based on this color's color space
378
- private setChannelIds ( space : KnownColorSpace ) {
378
+ private setChannelIds ( space : KnownColorSpace ) : void {
379
379
switch ( space ) {
380
380
case 'rgb' :
381
381
case 'srgb' :
@@ -940,10 +940,10 @@ export class SassColor extends Value {
940
940
spaceSetExplicitly : boolean
941
941
) : SassColor {
942
942
const color = this . toSpace ( space ) ;
943
- const getChangedValue = ( channel : ChannelName ) => {
943
+ function getChangedValue ( channel : ChannelName ) : number | null {
944
944
if ( isNumberOrNull ( options [ channel ] ) ) return options [ channel ] ;
945
945
return color . channel ( channel ) ;
946
- } ;
946
+ }
947
947
948
948
switch ( space ) {
949
949
case 'hsl' :
@@ -1099,7 +1099,7 @@ export class SassColor extends Value {
1099
1099
space ?: ColorSpaceXyz ;
1100
1100
}
1101
1101
) : SassColor ;
1102
- change ( options : ConstructorOptions ) {
1102
+ change ( options : ConstructorOptions ) : SassColor {
1103
1103
const spaceSetExplicitly = ! ! options . space ;
1104
1104
let space = options . space ?? this . space ;
1105
1105
if ( this . isLegacy && ! spaceSetExplicitly ) {
0 commit comments