Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 542 Bytes

File metadata and controls

38 lines (30 loc) · 542 Bytes

Interface

Créer et faire appliquer un contrat.

function publier(livre:{published:boolean}):void {
    // ... publication
    livre.published = true;
}

Mot clé interface

interface Publiable {
    published: boolean;
}
function publish(livre:Publiable):void {
    // ... publication
    livre.published = true;
}

Interface & héritage

  • Mot clé extends
interface Publiable {
    publie: boolean;
}

interface Editable {
    edite: boolean;
}

interface Livre extends Publiable, Editable {
}