TypeScriptプロジェクトをバージョン1.0からTypeScript 1.8にアップグレードしています。 最新のIgniteUI定義ファイル(v 16.1)も使用しています。このファイルは、既存のオブジェクトの初期化(この記事の最後にあるエラーを参照)では機能しません。TypeScript 1.0から1.8へのアップグレード後にIgniteUIのプロパティが表示されない
これはIgniteUI igTextEditorを使用して、当社の既存の活字体のコードです:
$(this.textinput).igTextEditor({
maxLength: this.maxChars,
textMode: sTextMode,
listItems: [""],
buttonType: "dropdown",
dropDownListOpening: function (evt, ui) {
formBase.setActiveForm(self.formID);
self.buttonClicked();
return false;
},
// Validator Options
validatorOptions: {
onblur: true,
onchange: false,
required: this.required,
notificationOptions: {
direction: "right",
showIcon: "true",
mode: "popover"
},
custom: function (value, fieldOptions) {
if (self.showError) {
self.showError = false;
if (self.errorMessage.length > 0) {
$(this.element).igValidator("option", "errorMessage", self.errorMessage);
}
return false;
}
self.validate(value);
return true;
}
},
keyup: function (evt, ui) { if (evt.keyCode == 13) { $(evt.currentTarget).blur() } },
focus: function() { formBase.setActiveForm(self.formID) }
});
ここigniteui.d.tsから関連するインタフェース定義です:
interface IgTextEditor {
textMode?: string;
maxLength?: number;
includeKeys?: string;
excludeKeys?: string;
toUpper?: boolean;
toLower?: boolean;
listMatchIgnoreCase?: boolean;
listMatchOnly?: boolean;
listMatchContains?: boolean;
listAutoComplete?: boolean;
}
interface JQuery {
igTextEditor(options: IgTextEditor): JQuery;
igTextEditor(optionLiteral: string, options: IgTextEditor): JQuery;
igTextEditor(optionLiteral: string, optionName: string, optionValue: any): JQuery;
igTextEditor(optionLiteral: string, optionName: string): any;
igTextEditor(methodName: string): any;
}
igniteui.dから、このコードでは唯一の変更.tsは:
igTextEditor(optionLiteral: string, optionName: any, optionValue: any): JQuery;
から:
igTextEditor(optionLiteral: string, optionName: string, optionValue: any): JQuery;
:
エラーTS2345:体系:型の引数「{[X:数]:未定義; maxLength:number; textMode:文字列; listItems:string []; buttonType:s ... 'は' string '型のパラメータに代入できません。
質問:考える活字体は1.8でタイプの検証と非常に厳しい、と<いずれかにキャスト>オプションではありません、どのようなコミュニティが示唆していることは、この状況に対処するための最良の方法ですか?
あなたがのIgnite UIのどのバージョンを使用していますか? –
Ignite UIのバージョン16.1 - 質問も更新されました。 – Victoria