שימוש ב-TypeScript עם IMA SDK
TypeScript היא שפת תכנות מונחת-אובייקטים עם סוגים מוגדרים מראש, שמתבצעת לה הידור ל-JavaScript. TypeScript הוא קבוצה גדולה יותר של JavaScript, ותומך בכל התכונות של JavaScript וגם בטיפוס סטטי אופציונלי.
כלים של TypeScript יכולים לעזור לזהות ולמנוע באגים שאולי לא תבחינו בהם ב-JavaScript רגיל.
שנתחיל?
DefinitelyTyped הוא פרויקט בקוד פתוח שמכיל מאגר של קובצי הצהרת סוגים למספר חבילות, כולל ספריית IMA SDK. אפשר להתקין את סוגי IMA באמצעות npm מהחבילה @types/google_interactive_media_ads_types.
npm install --save-dev @types/google_interactive_media_ads_types
אחרי ההתקנה, תהיה לכם גישה לכל הסוגים שמוצגים באובייקט google.ima
בקוד שלכם. אתם יכולים גם להשתמש בהשלמת קוד ובסיוע בתוכן לפונקציות ולמאפיינים של IMA בכלי לעריכת קוד מקור שיש בהם את התכונות האלה, למשל Visual Studio Code.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-03-07 (שעון UTC).
[null,null,["עדכון אחרון: 2025-03-07 (שעון UTC)."],[[["TypeScript is a strongly typed, object-oriented programming language that compiles to JavaScript and supports all of JavaScript's features plus optional static typing."],["TypeScript tooling helps in detecting and preventing bugs that might go unnoticed in plain JavaScript."],["DefinitelyTyped is an open-source project containing type declaration files for various packages, including the IMA SDK library."],["Installing the IMA types using npm from the @types/google-interactive-media-ads package gives you access to all types exposed by the google.ima object."],["After installation, source code editors with features like code completion and content assist can be used to take full advantage of IMA methods and properties."]]],[]]