@@ -17,8 +17,6 @@ export type AutomaticJsonStringConversion = Parameters<typeof JSON.stringify>[0]
1717 *
1818 */
1919export interface LazyJsonString extends String {
20- new ( s : string ) : typeof LazyJsonString ;
21-
2220 /**
2321 * @returns the JSON parsing of the string value.
2422 */
@@ -40,7 +38,7 @@ export interface LazyJsonString extends String {
4038 * This current implementation may look strange, but is necessary to preserve the interface and
4139 * behavior of extending the String class.
4240 */
43- export function LazyJsonString ( val : string ) : void {
41+ export const LazyJsonString = function LazyJsonString ( val : string ) : void {
4442 const str = Object . assign ( new String ( val ) , {
4543 deserializeJSON ( ) {
4644 return JSON . parse ( String ( val ) ) ;
@@ -56,7 +54,15 @@ export function LazyJsonString(val: string): void {
5654 } ) ;
5755
5856 return str as never ;
59- }
57+ } as any as {
58+ new ( s : string ) : LazyJsonString ;
59+ ( s : string ) : LazyJsonString ;
60+ from ( s : any ) : LazyJsonString ;
61+ /**
62+ * @deprecated use #from.
63+ */
64+ fromObject ( s : any ) : LazyJsonString ;
65+ } ;
6066
6167LazyJsonString . from = ( object : any ) : LazyJsonString => {
6268 if ( object && typeof object === "object" && ( object instanceof LazyJsonString || "deserializeJSON" in object ) ) {
@@ -68,6 +74,6 @@ LazyJsonString.from = (object: any): LazyJsonString => {
6874} ;
6975
7076/**
71- * @deprecated use from.
77+ * @deprecated use # from.
7278 */
7379LazyJsonString . fromObject = LazyJsonString . from ;
0 commit comments