2023-11-10 12:06:40 +03:00
import { ArrayExtensions } from "./array" ;
2023-12-10 21:44:41 +03:00
import { MapExtensions } from "./map" ;
2023-11-10 21:43:57 +03:00
import { StringExtensions } from "./string" ;
2023-11-10 12:06:40 +03:00
2023-12-28 17:18:12 +03:00
export type CallBackVoidFunction = < T > ( value : T ) = > void ;
export type CallBackStringVoidFunction = ( value : string ) = > void ;
2023-12-10 21:44:41 +03:00
2023-11-10 21:43:57 +03:00
declare global {
interface Array < T > {
// @strict: The parameter is determined whether the arrays must be exactly the same in content and order of this relationship or simply follow the same requirements.
equals ( array : Array < T > , strict : boolean ) : boolean ;
lastElement ( ) : T | undefined ;
isEmpty ( ) : boolean ;
2023-12-10 21:44:41 +03:00
isNotEmpty ( ) : boolean ;
hasIncludeElement ( element : T ) : boolean ;
2023-11-10 21:43:57 +03:00
}
interface String {
isEmpty ( ) : boolean ;
2024-01-23 17:23:10 +03:00
isNotEmpty ( ) : boolean ;
2023-11-10 21:43:57 +03:00
}
2023-12-10 21:44:41 +03:00
interface Map < K , V > {
2023-12-28 17:18:12 +03:00
addValueOrMakeCallback ( key : K , value : V , callBack : CallBackVoidFunction ) : void ;
2023-12-10 21:44:41 +03:00
}
2023-11-10 12:06:40 +03:00
}
2023-11-10 21:43:57 +03:00
export const extensions = ( ) = > {
ArrayExtensions ( ) ;
StringExtensions ( ) ;
2023-12-10 21:44:41 +03:00
MapExtensions ( ) ;
2023-11-10 21:43:57 +03:00
} ;