Forum Discussion
Nigel_Price9911
Jan 11, 2018Iron Contributor
I have upgraded from yeoman 1.3.4 to 1.4.0 and I cannot import mystrings.d.ts
I have a file mystrings.d.ts which contains :-
declare interface IReactSearchBoxStrings {
PropertyPaneSearchOptions: string;
BasicGroupName: string;
DefaultSearchResultsPageUrlFieldLabel: ...
- Jan 15, 2018
This is due to yeoman 1.4.0 using TypeScript 2.4.2 which starts to phase out .d.ts and @Typings.
So to fix rename "MyStrings.d.ts" to IReactSearchBoxStrings,ts. Change the contents to
export interface IReactSearchBoxStrings { PropertyPaneSearchOptions: string; BasicGroupName: string; DefaultSearchResultsPageUrlFieldLabel: string; EnableCustomSearchPlaceholderLabel: string; SearchLabel: string; CustomSearchPlaceholderModeOnAlert: string; }change
import * as strings from reactSearchBoxStrings
to
import { IReactSearchBoxStrings} from './components/IReactSearchBoxStrings';and finally add
var strings: IReactSearchBoxStrings;
Then it all compiles and links.
Regards
Nigel
Nigel_Price9911
Jan 15, 2018Iron Contributor
This is due to yeoman 1.4.0 using TypeScript 2.4.2 which starts to phase out .d.ts and @Typings.
So to fix rename "MyStrings.d.ts" to IReactSearchBoxStrings,ts. Change the contents to
export interface IReactSearchBoxStrings {
PropertyPaneSearchOptions: string;
BasicGroupName: string;
DefaultSearchResultsPageUrlFieldLabel: string;
EnableCustomSearchPlaceholderLabel: string;
SearchLabel: string;
CustomSearchPlaceholderModeOnAlert: string;
}
change
import * as strings from reactSearchBoxStrings
to
import { IReactSearchBoxStrings} from './components/IReactSearchBoxStrings';
and finally add
var strings: IReactSearchBoxStrings;
Then it all compiles and links.
Regards
Nigel