kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/typescript/testdata/namespace.ts (about)

     1  // Test indexing support for namespaces.
     2  
     3  //- @N defines/binding NNamespace
     4  //- NNamespace.node/kind record
     5  //- NNamespace.subkind namespace
     6  //- NNamespace.complete definition
     7  //- @N defines/binding NValue
     8  //- NValue.node/kind package
     9  //- Ndef defines NValue
    10  //- Ndef.loc/start @^"namespace"
    11  namespace N {
    12    //- @obj defines/binding NObj
    13    export const obj = {key: 'value'};
    14    //- Ndef.loc/end @$"}"
    15  }
    16  
    17  //- @N ref NValue
    18  //- @obj ref NObj
    19  N.obj;
    20  
    21  // Repeat same namespace to make
    22  // sure we don't output duplicate
    23  // facts.
    24  //- SecondNdef defines NValue
    25  //- SecondNdef.loc/start @^"namespace"
    26  namespace N {
    27    export const pinky = 1;
    28    //- SecondNdef.loc/end @$"}"
    29  }
    30  
    31  //- @Z defines/binding ZNamespace
    32  //- ZNamespace.node/kind record
    33  //- ZNamespace.subkind namespace
    34  //- @Z defines/binding ZValue
    35  //- ZValue.node/kind package
    36  //- Zdef defines ZValue
    37  //- Zdef.loc/start @^"Z"
    38  //- ThirdNDef defines NValue
    39  //- ThirdNDef.loc/start @^"namespace"
    40  namespace N.Z {
    41    export const blinky = 2;
    42    //- Zdef.loc/end @$"}"
    43    //- ThirdNDef.loc/end @$"}"
    44  }