Comment puis-je définir un type de retour void pour une fonction dans un fichier d'enregistrement de l'interface?

J'ai cette fonction:

   network = (action): void =>{
        if (action) {
            this.action = action;
            this.net = true;
            this.netd = true;
        } else {
            this.action = null;
            this.net = false;
            this.netd = false;
        }
    }

J'ai essayé de définir une interface, mais il ne fonctionne pas pour moi:

interface IStateService {
    network: (action: string): void;
}

Je reçois un message disant: "unexpected token" à vide

OriginalL'auteur Alan2 | 2014-07-28